摘要: 1 关于 通过SqlDataAdapter 插入DataSet中的数据到数据库 有两种方法: 2 3 (1) 4 5 使用SqlCommandBuilder 6 7 SqlConnection conn=new SqlConnection(); 8 conn.ConnectionString=ConfigurationManager.ConnectionStrings["TestDBConnectionString"].ConnectionString; 9 conn.Open();10 SqlCommand cmd=new SqlCommand();11 cmd.Comm 阅读全文
posted @ 2011-08-04 14:12 爱测试的猫咪 阅读(917) 评论(0) 推荐(0) 编辑
摘要: View Code 1 Public Sub connect() 2 Dim pass As Boolean 3 pass = False 4 Dim conn As New SqlConnection 5 Dim rs As New SqlCommand 6 Dim dataread As SqlDataReader 7 Dim constr As String 8 'Dim i As Integer 9 Dim sql As String10 constr = "server=PC-201105311336\SQLEXPRESS;Uid=sa;Pwd=123456;Dat 阅读全文
posted @ 2011-08-04 12:17 爱测试的猫咪 阅读(892) 评论(0) 推荐(1) 编辑
摘要: 代码如下:View Code 1 Public Class 全部学生信息 2 3 Dim conn As New SqlConnection 4 Dim rs As New SqlDataAdapter 5 'Dim dt As New DataTable 6 Dim ds As New DataSet 7 8 Public Function connect_db() As SqlConnection 9 Dim constr As String 10 constr = "Server=PC-201105311336\SQLEXPRESS;uid=sa;pwd=123456; 阅读全文
posted @ 2011-08-04 11:32 爱测试的猫咪 阅读(3006) 评论(0) 推荐(0) 编辑