Click here to Skip to main content
15,887,376 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
pls assist me by giving me simple code
Posted

Someone gave you code, but this request was both trivial and widely documented. Before you start writing database code, you should both own some books, and learn to use google.
 
Share this answer
 
C#
using (SqlConnection connection = new SqlConnection(
    @"Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;"))
{
    connection.Open();
    // Do work here; connection closed on following line.
}

Sample taken from MSDN[^] :)
 
Share this answer
 
use sqlclient class then set connection string to "Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;"
use that ecxacly the same as oledbConnection! :) :cool:

forgot to mention sorry
before u use that class its a need to declare its namespace by writing

using system.data.sqlclient

then follow that :thumbsup:
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900