全文预览

C#操作SQL经典

上传者:梦&殇 |  格式:pdf  |  页数:66 |  大小:11493KB

文档介绍
extBox l.Text;\rSqlCommand MyCommand=new SqlCommand(MyUpdate,MyConnection);\rtry\r(\rMyConnection.Open();\rMyCommand.ExecuteNonQueryO;\rMyConnection.Close();\rTextBoxl.Text='H,;\r)\rcatch(Exception ex)\r(\rConsole.WriteLine(n{0} Exception caught.ex);\r)\r¾Ÿ¿ÀP`\rstring\rMyConn="server= 127.0.0.1 ;uid=user;pwd= 123456;database=Northwind;Trusted_Connection=n\roM;\rSqlConnection MyConnection=new SqlConnection(MyConn);\rstring MyDelete="Delete from Categories where CategoryID=H+TextBox 1 .Text;\rSqlCommand MyCommand=new SqlCommand(MyDelete,MyConnection);\rtry\r(\rMyConnection.Open();\rMyCommand.ExecuteNonQueryO;\rMyConnection.Close();\rTextBoxl.Text=',M;\rcatch(Exception ex).\rConsole.WriteLine(" {0} Exception caught.n, ex);

收藏

分享

举报
下载此文档