Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Connect to anothe database

Reply
Thread Tools

Connect to anothe database

 
 
Husam
Guest
Posts: n/a
 
      05-30-2007
Hi EveryBody:

How can I connect to another database instaed of the default database
aspnetdb in the local SQL Server in the App_Data folder that exist in my web
site application ?

My database that I want to connect is in my local Machine and its name=Husam.

Any Help or redirection will be completely appreciated

regard's

Husam
 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      05-30-2007
On May 30, 10:42 am, Husam <(E-Mail Removed)> wrote:
> Hi EveryBody:
>
> How can I connect to another database instaed of the default database
> aspnetdb in the local SQL Server in the App_Data folder that exist in my web
> site application ?
>
> My database that I want to connect is in my local Machine and its name=Husam.
>
> Any Help or redirection will be completely appreciated
>
> regard's
>
> Husam


You should connect a database using connection string.

Example of connection string for SQL Server 2000

Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated
Security=SSPI;

More examples you can find here
http://www.connectionstrings.com/?carrier=sqlserver

string cs = "Data Source=myServerAddress;Initial
Catalog=myDataBase;Integrated Security=SSPI;"
using (SqlConnection cn = new SqlConnection(cs))
{
SqlCommand cmd = new SqlCommand();
.....

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Database Database Database scott93727@gmail.com Computer Information 0 09-27-2012 02:43 AM
DataBase DataBase DataBase DataBase scott93727@gmail.com Computer Information 0 09-26-2012 09:40 AM
Connect to anothe database =?Utf-8?B?SHVzYW0=?= ASP .Net 1 05-30-2007 04:33 PM
ASP.Net querying Active Directory works on one page and not anothe =?Utf-8?B?VHJleSBNaXRjaGVsbA==?= ASP .Net 0 07-19-2005 05:57 PM
Cannot make head or tail of dial watcher is there anothe option to restrict hours Cisco 801 Sean Rima Cisco 3 06-24-2005 05:59 PM



Advertisments