vb.net怎么用app.config的ConnectionString来连接数据库?
dimCnnassqlconnectiondimcmdassqlcommanddimdataRassqldatareaderIfPage.IsValidThenCnn=N...
dim Cnn as sqlconnection
dim cmd as sqlcommand
dim dataR as sqldatareader
If Page.IsValid Then
Cnn = New SqlConnection//这后边这么写??? 展开
dim cmd as sqlcommand
dim dataR as sqldatareader
If Page.IsValid Then
Cnn = New SqlConnection//这后边这么写??? 展开
1个回答
2013-11-07
展开全部
cnn.ConnectionString ="server=.;uid=sa;pwd=;database=库名";
cnn.open();
cmd.connection=cnn;
cmd.commandText=sql;
cmd.commandType=commandType.text;
dataR.selectcommand=cmd;
cnn.open();
cmd.connection=cnn;
cmd.commandText=sql;
cmd.commandType=commandType.text;
dataR.selectcommand=cmd;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询