public class system
{
public string constring = ConfigurationManager.ConnectionStrings["Connection"].ConnectionString;
public system()
{
//
// TODO: 在此处添加构造函数逻辑
//
} public string select_notice()
{
SqlConnection con = new SqlConnection(constring);
con.Open();
SqlCommand cmd = new SqlCommand("notice", con);
cmd.CommandType = CommandType.StoredProcedure;
string notice = cmd.ExecuteScalar().ToString();
con.Close();
}
}
希望大家帮帮忙!偶不胜感激。
{
public string constring = ConfigurationManager.ConnectionStrings["Connection"].ConnectionString;
public system()
{
//
// TODO: 在此处添加构造函数逻辑
//
} public string select_notice()
{
SqlConnection con = new SqlConnection(constring);
con.Open();
SqlCommand cmd = new SqlCommand("notice", con);
cmd.CommandType = CommandType.StoredProcedure;
string notice = cmd.ExecuteScalar().ToString();
con.Close();
}
}
希望大家帮帮忙!偶不胜感激。
解决方案 »
- 50分!!!! asp.net实现下载功能(急需)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>___________
- 急!急!急!asp.net中如何实现在线充值功能啊!
- 关于GUID的问题
- 使用vs2010创建asp.net 应用项目,利用了其现成的登录模板;但是数据库改成单独服务器并删除了App_data,密码验证自己方法,结果在登录时出现错误
- 就是那个网站点击赞的那个功能,游客也可以实现,每隔30分钟可以点击一次的功能如何实现
- ASP.NET2.0中使用用户控件问题求救!!
- GridView1 分页 激发了未处理的事件“PageIndexChanging
- 太奇怪了,写了千遍的语句这次运行说操作符丢失。
- 请问,哪位知道,哪里有免费的支持ASP.NET的host空间啊(最重要的是要支持.dll的)? webmatrixhosting 9月15日后就不提供免费服务了!
- VB编asp打开文件的问题?
- 【在线等解决】asp.net开发WEB SITE,如何处理外部引用的DLL
- asp.net怎么实现边输入TextBox边检索数据库表,动态显示内容。类似于百度的搜索框!
{
SqlConnection con = new SqlConnection(constring);
con.Open();
SqlCommand cmd = new SqlCommand("notice", con);
cmd.CommandType = CommandType.StoredProcedure;
string notice = cmd.ExecuteScalar().ToString();
con.Close();
return "";
}
{
SqlConnection con = new SqlConnection(constring);
con.Open();
SqlCommand cmd = new SqlCommand("notice", con);
cmd.CommandType = CommandType.StoredProcedure;
string notice = cmd.ExecuteScalar().ToString();
con.Close();
}
{
SqlConnection con = new SqlConnection(constring);
con.Open();
SqlCommand cmd = new SqlCommand("notice", con);
cmd.CommandType = CommandType.StoredProcedure;
string notice = cmd.ExecuteScalar().ToString();
con.Close();
return notice;//方法要返回撒
}
应该添加一个return notice;
public string select_notice()
{
SqlConnection con = new SqlConnection(constring);
con.Open();
SqlCommand cmd = new SqlCommand("notice", con);
cmd.CommandType = CommandType.StoredProcedure;
string notice = cmd.ExecuteScalar().ToString();
con.Close();
return notice;//本身是个string返回值的方法,所以必须返回一个字符串
}