易截截图软件、单文件、免安装、纯绿色、仅160KB

sql c#

C-#入门经典(第三版).pdf
using System;
using System.Data;
using System.Data.SqlClient;
namespace My_Student
{
    static class Program
    {
       
        static void Main()
        {
            //连接字符串,连接本地的MS SQL Server服务器
            string connString = "data source=MICROSOF-84BB45;persist security info=False;initial catalog=MyDB;integrated security=SSPI;";
            //SQL语句,删除记录
            string sqlString = "delete from Courses where CourseNo='001'";
            //建立连接对象
            SqlConnection conn = new SqlConnection(connString);
            conn.Open();//打开连接
            //建立数据命令对象
            SqlCommand cmd = new SqlCommand(sqlString, conn);
            //执行命令,返回影响的行数
            int rowsReturned = cmd.ExecuteNonQuery();
            Console.WriteLine("{0} 记录已删除", rowsReturned);
            MessageBox.Show("数据库更新成功!!");
            conn.Close();//关闭连接
        }
    }
}
try
       &nb


相关文档:

Sql(事物+游标)使用方法

--当两个或两以上的操作要么都执行,要么都不执行时要用事务。
1. Sql写法(事物+游标)
--开始事务
BEGIN TRAN
--不显示计数信息
SET NOCOUNT ON
DECLARE @ProjNo varchar(50),@CusNo varchar(50)
--声明游标
DECLARE CRMPSContact_cursor CURSOR FOR 
SEL ......

使用VB将Excel导入到Sql中

使用VB把Excel导入到Sql数据库中,其实有几种方法。
下面我介绍的这种方法,较为简单。
其实这种方法的话,是直接使用T-SQL操作的,因此,到了VB里面,直接eccute这个代码就OK了的。
-----------------------------------------------------下面是在T-sql中的语句
if object_id('NewTable') is not null/*判断表NewTabl ......

asp.net(c#) 下SQL存储过程使用详细实例

记取记录集
create procedure getArticle
as
select * from Article_Content
GO
asp.net 调用方法
  SqlConnection Conn = new SqlConnection();
        Conn.ConnectionString = Data.Connstr();
        Conn.Open();
  ......

EXCEL生成SQL建表存储过程的VBA脚本

HO~HO~EXCEL生成SQL建表存储过程的VBA脚本^_^赞一下
2007-12-11 10:39
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 全局变量定义
Const MAX_COLUMN_NUM = 50
Dim stOutputPath As String
Dim stOutputFile As String
Dim stDBName As String
Dim stUserName As String
Dim stUserPasswd As ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号