asp.net中的连接字符串问题 [英] connection string problem in asp.net

查看:49
本文介绍了asp.net中的连接字符串问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SqlConnection conn = new SqlConnection("Data Source=TWS\\SQLEXPRESS;Initial Catalog=db_umesh;Integrated Security=SSPI;");


这是正确的字符串吗?
我从connectionstrings.com上取了,但是
我的完整代码在这里,但未在gridview中显示值.请帮帮我
谢谢


Is this a correct string or not?
i taken this from connectionstrings.com but
my fully code is here but its not showing values in gridview please help me
thanks

SqlConnection conn = new SqlConnection("Data Source=TWS\\SQLEXPRESS;Initial Catalog=db_umesh;Integrated Security=SSPI;");
string qry = "select * from tbl_course";
SqlCommand cmd = new SqlCommand(qry, conn);
try
{
  cmd.Connection.Open();
  gv1.DataSource = cmd.ExecuteReader();
  gv1.DataBind();
}
catch (Exception ex)
{
  lblmsg.Text = ex.ToString();
}
finally
{
  conn.Close();
}
}


谢谢和问候,
Umesh Daiya:)


Thanks and regards,
Umesh Daiya :)

推荐答案

您遇到什么问题,请解释.

此处 [ ^ ]您"会为您的应用程序找到正确的连接字符串.
What problem you are getting, please explain.

Here[^] you''ll find correct connectionstring for your application.


这篇关于asp.net中的连接字符串问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆