C#:SqlConnection 当前上下文中不存在名称SqlHelper

来源:百度知道 编辑:UC知道 时间:2024/05/28 06:41:46
using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Linq;
using System.Web.Security;
using System.Configuration;

/// <summary>
///Msg 的摘要说明
/// </summary>
public class Msg
{
private const string SQL_PARM_RECEIVE = "@receive";
private const string SQL_PARM_SEND = "@SEND";
private const string SQL_PARM_TITLE = "@title";
private const string SQL_PARM_CONTENT = "@content";
private const string SQL_INSERT_MESSAGE = "INSERT INTO message VALUES(@receive,@send,@title,@content,'0')";
public Msg()
{
//
//TODO: 在此处添加构造函数逻辑
//
}

public bool SendMSG(string receive, string send, string title, string content)
{
if (Membership.FindUsersByName(receive) == null)
return false;
else
{
SqlParameter[

看看你的App_Code里有没有SqlHelper这个CS

SqlHelper是一个数据库操作类,网上有可以下载一个。

1.看看你的App_Code里有没有SqlHelper这个CS
2.如果有,看看它的namespace是什么
3.在你需要的地方useing这个namespace
4.问题解决

看看你的App_Code里有没有SqlHelper这个CS

SqlHelper是一个数据库操作类

下载SqlHelper.cs
说明文件
http://www.microsoft.com/china/MSDN/library/EnterpriseDevelopment/BuildDistApp/Vsdnbdadaab_rm.mspx?mfr=true
下载文件
http://www.microsoft.com/downloads/details.aspx?FamilyID=f63d1f0a-9877-4a7b-88ec-0426b48df275&DisplayLang=en