Saturday, December 4, 2010

khởi tạo kết nối tới SQL Server C#

khởi tạo kết nối tới SQL Server
SqlConnection sqlConn = new SqlConnection("Server=SQLDB;uid=sa;pwd=password;database=pubs");

Insert
SqlCommand insCom = new SqlCommand("INSERT INTO employee VALUES ('AR D4372','Andrew','P','Batter','61000876','1999-10-11T00:00:00')",sqlConn);

Update
SqlCommand updCom = new SqlCommand("UPDATE employee SET job_id=1 WHERE fname='Pedro'",sqlConn);

Delete

No comments:

Post a Comment