Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Opening a connection to Sql Server using C#
Message
From
02/08/2001 02:09:17
Mahabeer B.
Wipro Technologies
Hyderabad, India
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Opening a connection to Sql Server using C#
Miscellaneous
Thread ID:
00538714
Message ID:
00538714
Views:
28
Hi,

I am trying to connect to a local SQL Server on the Network using the
following code in Beta2(System.Data.SqlClient).

#####

string sConn = "User ID=sa;Pwd=;Database=lib;Server=rukku;Integrated
Security=false";

string sCommand = "SELECT max(book_id)from book_details";
SqlCommand myCommand = new SqlCommand(sCommand);
myCommand.Connection = new SqlConnection(sConn);
myCommand.Connection.Open();

#####

But I am getting a SecurityException.

Do I need to setup special permission on the SQL Server before executing
these statements, because I am getting some Permission problems.The error is occurring at the Open() statement. Can anyone help !


Regds,
Mahabeer
÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷
B. Mahabeer Singh
Systems Engineer
Wipro Technologies,
Hyd,AP,India.
Next
Reply
Map
View

Click here to load this message in the networking platform