Showing posts with label developing. Show all posts
Showing posts with label developing. Show all posts

Wednesday, March 28, 2012

Newbie question about SQL Server 2005

Hi,

I have a very newbie question.

I have been only developing websites locally on my computer (during my learning curve) and never actually put anything up in a server on internet, but I just bought a server from discountasp.net and an extra SQL 2005 Database.

Now I need to put my database on that server (copy the local one) I know I have a connection string and username and password. But I really do not have any ideas how to do this.

I would appreciate if you tell me where to start and what I should do at this stage.

Thank you and have a good day.

Use SQL Server 2005 Management Studio to connect to your databse on server. And after that you can import the databse from local database.|||Thank you, but is there any tutorials explaining this in more detail ?|||

Hi,

This tutorial might prove useful on the issue of migrating databases:

http://msdn2.microsoft.com/en-us/library/ms188032.aspx

Cheers

|||

The tutorial may help.

http://aspnet.4guysfromrolla.com/articles/050907-1.aspx

Monday, March 26, 2012

Newbie question - Best practices for local/remote development?

Excuse me, I'm a relative newbie.

My question: What's the best practice for developing locally and then uploading to a production web site?"

Here's my plan:

I will use ASP.NET 2.0. I want to use Visual Web Developer 2005 Express Edition to develop locally using SQL Server 2005 Express Edition (.mdf file).

Then I want to upload my changes to a web site that uses the full version of SQL Server 2005 (not the Express Edition.)

I know how to upload my .aspx files to the remote site using Visual Web Developer.

But how should I handle my data? I imagine I can keep a little test data in my local .mdf database, and then just make sure the tables on the remote SQL Server always exactly mirror what I've got locally.

Then I just upload any changed .aspx files, which should work both locally and remotely.

Is this the best way? Or will I have to every time first change something in my .aspx files, to handle the data connection difference between my local db to the remote db?

Much ThanksThe convention is to store your database ConnectionString in the Web.Config file. Then you will only have one place to change it. See http://www.dotnetjohn.com/articles.aspx?articleid=3

Wednesday, March 21, 2012

newbie query help

hello all,i am developing an application which displays available pcs in our lab.all activites are stored in a sql server table.Sql server 2000

Table structure is field name datatype null values
logon varchar(6) canbe null (values = login or logoff)
username varchar(20) canbe null (eg user01,B023)
computername varchar(20) canbenull (if its in lab1 name will be lab1-01,lab1-02..,if its in lab2 name will be lab2-01,lab2-02.)
logontime datetime(8) canbenull (26/11/2002 11:17:52)

table sample is

Logon computername username logontime



Login lab1-01 x 2003-07-09 11:17:00.000

Login lab1-03 y 2003-07-09 11:19:00.000

Logoff lab1-01 x 2003-07-09 11:20:00.000

with these details is it possible to see currently how many machines r occupied in each lab.if so how?i am planning to write an asp page which will display currently available machines,so tat user can go to particular lab .i am a sql newbie .if any 1 can guide me tat wuld be helpful for me .thx in advance

-regards
aravindas far as i can see (im finding it hard to understand exactly what fields will be in your database) all you should need to extract the info is something along the lines of:

select from tableA computername
where (logon = ' ')

presuming the table is called 'tableA'

you might be better off having another field of type boolean which simply shows whether anyone is logged into the machine, maybe 0 for vacant or 1 for in-use.

hope this helps|||assume that a computer is "occupied" when the latest logon for it is "Login"

this query will list the individual machines:
select computername
, logontime as LastLoginTime
from yourtable as TT
where logontime
= ( select max(logontime)
from yourtable
where logontime = TT.logontime )
and logon = 'Login'
order
by computername
this query will count them by lab and list them in order by the fewest occupied to the most:
select left(computername,4) as Lab
, count(*) as OccupiedCount
from yourtable as TT
where logontime
= ( select max(logontime)
from yourtable
where logontime = TT.logontime )
and logon = 'Login'
group
by left(computername,4)
order
by 2
rudy|||How can you tell if they are occupied if all you have is the last logon time? You need a field that indicates their logoff time as well. With that, you can not only tell which machines are occupied (at least one associated logon has a null logoff time), but also other valuable information such as usage patterns.

blindman|||blindman, the logoffs are there, as separate rows

that's why my query checks for when the latest logon for the machine is "Login"

:)|||hello all thx for ur replies ,i didt read ur query.i created a new table with computername,status (which can be login or logoff) ,when old table gets inserted it triggers an event which sets the status of particular machine in new table .now i can query the new table to see the availability...is it a good practice? its my first sql prg .gimme some inputs

-regards
aravind|||Ahh...I see your logoff rows now. I've worked tables that way before, but I prefer storing logoffs as a separate field rather than a separate record. That way each row represents a single session and it makes calculations easier. By using a separate field you don't need the Max subquery, and finding the total amount of time for a particular user across sessions is as simple as sum(LogoffTime - LogonTime).

blindman

Monday, March 19, 2012

Newbie needs to be told where to go! (Cross-Post)

Greetings:
I've been developing web applications with asp/sql and access for some
time now on existing servers. I am now in a situation that requires me to
install SQL Server (SBS 2K sp3) as the backend for an intranet served from
IIS. I've installed the SQL services and have created the database and I
have some of the web based application written, no problem, but I've yet to
be able to access the database that I created on the newly installed SQL
server from the web based applications. Even after setting up the virtual
directory with the IIS SQL snap-in, I only get a DNS Server not found error
when I try to browse the site. If I remove the IIS/SQL virtual directory, I
can browse pages that don't error out due to data references.
Where can I find a walk through for setting up SQL Server and IIS to
function together in this very basic manner?
Thanks in advance.
--
Jerry M. Gartner
www.gartnerwebdev.comHi,
Have a look at these...
http://support.microsoft.com/default.aspx?scid=kb;EN-
US;176378
http://support.microsoft.com/default.aspx?scid=kb;EN-
US;176380
http://support.microsoft.com/default.aspx?scid=kb;zh-
cn;chs264921
http://support.microsoft.com/default.aspx?scid=kb;PL;264921
http://support.microsoft.com/default.aspx?scid=kb;EN-
US;245243
>--Original Message--
>Greetings:
> I've been developing web applications with asp/sql
and access for some
>time now on existing servers. I am now in a situation
that requires me to
>install SQL Server (SBS 2K sp3) as the backend for an
intranet served from
>IIS. I've installed the SQL services and have created
the database and I
>have some of the web based application written, no
problem, but I've yet to
>be able to access the database that I created on the
newly installed SQL
>server from the web based applications. Even after
setting up the virtual
>directory with the IIS SQL snap-in, I only get a DNS
Server not found error
>when I try to browse the site. If I remove the IIS/SQL
virtual directory, I
>can browse pages that don't error out due to data
references.
> Where can I find a walk through for setting up SQL
Server and IIS to
>function together in this very basic manner?
>Thanks in advance.
>
>--
>Jerry M. Gartner
>www.gartnerwebdev.com
>
>.
>|||Peter:
Preliminarily, this appears to be what I'm looking for. I didn't think
to use ODBC and a DSN. What are the major differences between ODBC and
"direct" connection? There will be under 30 clients using the DB - this is
an on demand intranet application and will be hit lightly and sporadically
throughout the day. The SQL server is also the PDC and fileserver/DFS root
and gateway. (2K SP4)
--
Jerry M. Gartner
www.gartnerwebdev.com
"Peter" <anonymous@.discussions.microsoft.com> wrote in message
news:03de01c3a83a$14ef9140$a001280a@.phx.gbl...
> Hi,
> Have a look at these...
> http://support.microsoft.com/default.aspx?scid=kb;EN-
> US;176378
> http://support.microsoft.com/default.aspx?scid=kb;EN-
> US;176380
> http://support.microsoft.com/default.aspx?scid=kb;zh-
> cn;chs264921
> http://support.microsoft.com/default.aspx?scid=kb;PL;264921
> http://support.microsoft.com/default.aspx?scid=kb;EN-
> US;245243

Monday, March 12, 2012

Newbie Help - Express exporting

I have been happily developing a site in Visual Express utilising SQL Express
and then tried to copy to my ISP (GoDaddy). They provide a SQL Server
database. After some mucking around I have worked out that my App Data folder
has nothing to do with the ISP Sql Server DB.
The connection Strings neded for eth ISP do not go to the Express App_data
and it appears I have to recreate my DB in the ISP's SQL Server. Is there any
way of converting / exporting my SQL Express info to the SQL Server DB
including the content not just the structure?
Sorry if it is a really daft question but ... I will get smarter eventually!
Hi
It is not clear if you have an user instance or not! If you are using a user
instance then you should change the connection string so that you don't have
the AttachDbFilename clause. You can either restore a backup of the database
or copy the mdf and ldf files and re-attach hem as described in
http://support.microsoft.com/kb/224071/
John
"Dajuroka" wrote:

> I have been happily developing a site in Visual Express utilising SQL Express
> and then tried to copy to my ISP (GoDaddy). They provide a SQL Server
> database. After some mucking around I have worked out that my App Data folder
> has nothing to do with the ISP Sql Server DB.
> The connection Strings neded for eth ISP do not go to the Express App_data
> and it appears I have to recreate my DB in the ISP's SQL Server. Is there any
> way of converting / exporting my SQL Express info to the SQL Server DB
> including the content not just the structure?
> Sorry if it is a really daft question but ... I will get smarter eventually!

Newbie Help - Express exporting

I have been happily developing a site in Visual Express utilising SQL Expres
s
and then tried to copy to my ISP (GoDaddy). They provide a SQL Server
database. After some mucking around I have worked out that my App Data folde
r
has nothing to do with the ISP Sql Server DB.
The connection Strings neded for eth ISP do not go to the Express App_data
and it appears I have to recreate my DB in the ISP's SQL Server. Is there an
y
way of converting / exporting my SQL Express info to the SQL Server DB
including the content not just the structure'
Sorry if it is a really daft question but ... I will get smarter eventually
!Hi
It is not clear if you have an user instance or not! If you are using a user
instance then you should change the connection string so that you don't have
the AttachDbFilename clause. You can either restore a backup of the database
or copy the mdf and ldf files and re-attach hem as described in
http://support.microsoft.com/kb/224071/
John
"Dajuroka" wrote:
[vbcol=seagreen]
> I have been happily developing a site in Visual Express utilising SQL Expr
ess
> and then tried to copy to my ISP (GoDaddy). They provide a SQL Server
> database. After some mucking around I have worked out that my App Data fol
der
> has nothing to do with the ISP Sql Server DB.
> The connection Strings neded for eth ISP do not go to the Express App_data
> and it appears I have to recreate my DB in the ISP's SQL Server. Is there
any
> way of converting / exporting my SQL Express info to the SQL Server DB
> including the content not just the structure'
> Sorry if it is a really daft question but ... I will get smarter eventually![/vbc
ol]

Newbie Help - Express exporting

I have been happily developing a site in Visual Express utilising SQL Express
and then tried to copy to my ISP (GoDaddy). They provide a SQL Server
database. After some mucking around I have worked out that my App Data folder
has nothing to do with the ISP Sql Server DB.
The connection Strings neded for eth ISP do not go to the Express App_data
and it appears I have to recreate my DB in the ISP's SQL Server. Is there any
way of converting / exporting my SQL Express info to the SQL Server DB
including the content not just the structure'
Sorry if it is a really daft question but ... I will get smarter eventually!Hi
It is not clear if you have an user instance or not! If you are using a user
instance then you should change the connection string so that you don't have
the AttachDbFilename clause. You can either restore a backup of the database
or copy the mdf and ldf files and re-attach hem as described in
http://support.microsoft.com/kb/224071/
John
"Dajuroka" wrote:
> I have been happily developing a site in Visual Express utilising SQL Express
> and then tried to copy to my ISP (GoDaddy). They provide a SQL Server
> database. After some mucking around I have worked out that my App Data folder
> has nothing to do with the ISP Sql Server DB.
> The connection Strings neded for eth ISP do not go to the Express App_data
> and it appears I have to recreate my DB in the ISP's SQL Server. Is there any
> way of converting / exporting my SQL Express info to the SQL Server DB
> including the content not just the structure'
> Sorry if it is a really daft question but ... I will get smarter eventually!

Wednesday, March 7, 2012

Newbie advise

Hi
I am going to begin my first sql server app with vb.net front end. Is there
somewhere I can read on good practices on developing sql server apps, or is
there a sample app that I can see as an example?
Thanks
Regards
I'd check the "How Do I" Videos from MSDN if you're just starting out.
This link is specific to Visual Basic.NET
http://msdn2.microsoft.com/en-us/vbasic/bb466226.aspx
"John" <info@.nospam.infovis.co.uk> wrote in message
news:eHk$nX8iIHA.5280@.TK2MSFTNGP02.phx.gbl...
> Hi
> I am going to begin my first sql server app with vb.net front end. Is
> there somewhere I can read on good practices on developing sql server
> apps, or is there a sample app that I can see as an example?
> Thanks
> Regards
>
|||Here are the samples and starter kits for SQL Server 2005 Express with have
plenty of examples in VB.NET:
http://msdn2.microsoft.com/en-us/express/bb403187.aspx
http://msdn2.microsoft.com/en-us/express/aa718396.aspx
HTH,
Plamen Ratchev
http://www.SQLStudio.com
|||My latest book is a good match for you. See www.betav.com for details or
just visit
http://www.amazon.com/Hitchhikers-Guide-Visual-Studio-Server/dp/0321243625.
It walks you through how SQL Server works in terms anyone can understand and
uses VB.NET for all of the examples from simple to far more sophisticated
approaches.
__________________________________________________ ________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
__________________________________________________ __________________________________________
"John" <info@.nospam.infovis.co.uk> wrote in message
news:eHk$nX8iIHA.5280@.TK2MSFTNGP02.phx.gbl...
> Hi
> I am going to begin my first sql server app with vb.net front end. Is
> there somewhere I can read on good practices on developing sql server
> apps, or is there a sample app that I can see as an example?
> Thanks
> Regards
>
|||On Mar 21, 10:39Xpm, "John" <i...@.nospam.infovis.co.uk> wrote:
> Hi
> I am going to begin my first sql server app with vb.net front end. Is there
> somewhere I can read on good practices on developing sql server apps, or is
> there a sample app that I can see as an example?
>
While it's actually a Visual Studio.Net reference, it has a lot of
material that covers data access in your .Net applications:
http://www.learnvisualstudio.net
Good luck!
Richard Carpenter

Newbie advise

Hi
I am going to begin my first sql server app with vb.net front end. Is there
somewhere I can read on good practices on developing sql server apps, or is
there a sample app that I can see as an example?
Thanks
RegardsI'd check the "How Do I" Videos from MSDN if you're just starting out.
This link is specific to Visual Basic.NET
http://msdn2.microsoft.com/en-us/vbasic/bb466226.aspx
"John" <info@.nospam.infovis.co.uk> wrote in message
news:eHk$nX8iIHA.5280@.TK2MSFTNGP02.phx.gbl...
> Hi
> I am going to begin my first sql server app with vb.net front end. Is
> there somewhere I can read on good practices on developing sql server
> apps, or is there a sample app that I can see as an example?
> Thanks
> Regards
>|||Here are the samples and starter kits for SQL Server 2005 Express with have
plenty of examples in VB.NET:
http://msdn2.microsoft.com/en-us/express/bb403187.aspx
http://msdn2.microsoft.com/en-us/express/aa718396.aspx
HTH,
Plamen Ratchev
http://www.SQLStudio.com|||My latest book is a good match for you. See www.betav.com for details or
just visit
http://www.amazon.com/Hitchhikers-Guide-Visual-Studio-Server/dp/0321243625.
It walks you through how SQL Server works in terms anyone can understand and
uses VB.NET for all of the examples from simple to far more sophisticated
approaches.
--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________
"John" <info@.nospam.infovis.co.uk> wrote in message
news:eHk$nX8iIHA.5280@.TK2MSFTNGP02.phx.gbl...
> Hi
> I am going to begin my first sql server app with vb.net front end. Is
> there somewhere I can read on good practices on developing sql server
> apps, or is there a sample app that I can see as an example?
> Thanks
> Regards
>|||On Mar 21, 10:39=A0pm, "John" <i...@.nospam.infovis.co.uk> wrote:
> Hi
> I am going to begin my first sql server app with vb.net front end. Is ther=e
> somewhere I can read on good practices on developing sql server apps, or i=s
> there a sample app that I can see as an example?
>
While it's actually a Visual Studio.Net reference, it has a lot of
material that covers data access in your .Net applications:
http://www.learnvisualstudio.net
Good luck!
--
Richard Carpenter

Saturday, February 25, 2012

Newbie RDL to RDLC Conversion

Hi,
I am developing a few reports using the Micrsoft report server which
create a "RDL" file. I was wondering if I can directly transfer these
reports to my ASP.Net application and convert them to the RDLC format?
can anybody provide any information about this functionality?
ThanksAssuming they are RS 2005 files all you have to do is change the extension
and bring them into you project.
I looked at using the viewer control in local mode (which is what you are
talking about doing) and if you have a RS server around you are much better
off to use it in server mode. There is a lot of mucking around that you have
to do with local reports. For instance, for a subreport you have to wire up
an event. It is nothing all that difficult but between hooking up events,
retrieving the data etc it is a good bit more effort than just calling the
report and passing a parameter.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Momomo" <le_mo_mo@.yahoo.com> wrote in message
news:1188354990.554512.26060@.k79g2000hse.googlegroups.com...
> Hi,
> I am developing a few reports using the Micrsoft report server which
> create a "RDL" file. I was wondering if I can directly transfer these
> reports to my ASP.Net application and convert them to the RDLC format?
> can anybody provide any information about this functionality?
> Thanks
>|||Hi,
Thank you for the response.How do I deal with "RDS (Shared Data
Source)" and "RDL.Data" files? hwo di I migrate those to my web site?
Mo|||I think you are a bit confused about how the control works. First, you are
using the reportviewer control that ships with VS 2005. It comes both as a
webform and as a winform control. Assuming you are then you need to decide
whether you want to use local mode or server mode. In server mode it
connects to RS server. You provide the parameters and it calls and then
displays the report. This is pretty straight forward to implement. In local
mode you give it the report (rdlc file) and hand it the dataset (really a
datatable). You have total control and you have to do more work.
RS does not have an RDL file on the server, it stores the object. You have
to save the report from Report Manager or get it out of the original VS
project that created the reports.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Momomo" <le_mo_mo@.yahoo.com> wrote in message
news:1188418919.496400.315330@.57g2000hsv.googlegroups.com...
> Hi,
> Thank you for the response.How do I deal with "RDS (Shared Data
> Source)" and "RDL.Data" files? hwo di I migrate those to my web site?
> Mo
>

Monday, February 20, 2012

newbe ? re:date format

Hi, I'm developing a page in asp.net using a sqldb and one of the values I'm sending to the database is a date/time value. I only want the table to show the date in short format, no time. Is there a way to restrict or convert the data in the table design mode?
Thanks
RaifSQL Server dates are stored as numeric values that interpreted as dates with time of day. Formatting of output should be handled by your user interface, not the database server.|||Thanks I sort suspected that as I started writing the post.
Thanks again|||Go with a smalldatetime in the sql table so that you are only using a (4). The go with a .ToString() and something like this:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatetimeclasstostringtopic4.asp
Hope it helps.|||If you're doing straight SELECT from your ASP, you can use CONVERT(char(10), <your_date_field>, 101) on your date/time field.