社区
C#
帖子详情
在window form中如何连sql server数据库,谢谢
jjyzhw111
2003-08-21 03:05:53
在window form中如何连sql server数据库,谢谢
...全文
78
4
打赏
收藏
在window form中如何连sql server数据库,谢谢
在window form中如何连sql server数据库,谢谢
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
4 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
jjyzhw111
2003-08-21
打赏
举报
回复
thanks a lot of
dahuzizyd
2003-08-21
打赏
举报
回复
string strSql = "select department.* from department";
string strConn ="data source=YL5;initial catalog=Address;workstation id=YL5;packet size=4096";
SqlConnection conn = new SqlConnection(strConn);
SqlCommand cmd_dep = new SqlCommand(strSql,conn);
SqlDataAdapter adp_dep = new SqlDataAdapter();
adp_dep.SelectCommand = cmd_dep;
DataSet ds = new DataSet();
conn.Open();
adp_dep.Fill(ds);
建议你还是先看看帮助:
Visual Basic 和Visual C# --访问数据--数据演练
yanyunpaladin
2003-08-21
打赏
举报
回复
sdk里类库的例程多得就是,看看就行了^_^
system.data.xxx随便看一个就行了
zhehui
2003-08-21
打赏
举报
回复
string sqltxt="Persist Security Info=False;User ID=sa;Initial Catalog=zhongtian;Data Source=ytf;Password=xu;";
SqlConnection sqlcon=new SqlConnection(sqltxt);
try
{
sqlcon.Open();
SqlCommand sqlcm=new SqlCommand("select Max(product_id) from product_class where product_id like '"+e1+"__'",sqlcon);
SqlDataReader dr=sqlcm.ExecuteReader();
if(dr.Read())
{
if(e1.Length==4)
{
textBox1.Text=Int32.Parse(dr.GetValue(0).ToString().Substring(4));
}
//else
//{
// textBox1.Text=dr.GetValue(0).ToString().Substring(6);
//}
//textBox1.Text=dr.GetValue(0).ToString();
sqlcon.Close();
}
}
catch(System.Data.SqlClient.SqlException ex)
{
MessageBox.Show(ex.Message);
}
finally
{
sqlcon.Close();
}
}
Window
Server
2012系统安装说明
功能测试或性能测试,一般都要由测试人员搭建测试环境,而服务器环境的搭建更为重要,那么就涉及到服务器操作系统的选择和安装,本课程主要讲解
Window
Server
2012系统安装说明。
delphi 连接
SQL
Server
数据库
server
数据库
databasequery DELPHI
中
的
数据库
开发有很多种类的,可以连接Access
数据库
,
SQL
Server
数据库
,Orical
数据库
,My
SQL
数据库
等等,一般基于连接有两种方式,BDE和ADO两种方式,BDE一般就是楼上的方式,ADO也...
Python Tkinter窗体程序连接
SQL
Server
数据库
实现账号登录、注册、修改、注销等功能(不定时更新)
Python窗体程序连接
SQL
Server
数据库
实现账号登录、注册、修改和注销等功能。
vs连接服务器
sql
server
数据库
web.config和代码
(1) appSettings 是在 2003
中
常用的,connectionStrings 是在 2005
中
常用的;第三,可方便的更换
数据库
平台,如换为 Oracle
数据库
,只需要修改 providerName。第二,可直接绑定数据源控件,而不必写代码读出来再...
Win
Form
(C#):登录页面实现+
SQL
Server
数据库
连接方式
//到
数据库
中
验证 string select
Sql
= "select * from tb_user where username='" +username+ "' and password='" +password+ "'" ;
Sql
Help
sql
Helper = new
Sql
Help(); int count =
sql
Helper....
C#
110,533
社区成员
642,574
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章