一个调用的问题,急、急、急......
static void getSMSContent(string mobile, string senderaddi, string recvaddi, string ct, string sd, ref int flag)
{
string strmob = mobile;
string strcontent = ct;
if (flag == 1)
{
string strsql = "insert into RecvMsg(Tele,msg,RecvTime) values('" + strmob + "','" + strcontent + "',getdate())";
SqlCommand cmdsql2 = new SqlCommand(strsql, conn);
cmdsql2.ExecuteNonQuery();
}
}
public delegate void deleSQF(string mobile, string senderaddi, string recvaddi, string ct, string sd, ref int flag);
deleSQF mySmsContent = new deleSQF(getSMSContent);
public void ReceiveRun()
{
while (true)
{
int result = ReceiveSMS(spname.Text, mySmsContent);
“SQL语句”
}
}
一直提示这个错误:
CONN 非静态的字段、方法或属性“SPSERVER.Form1.conn”要求对象引
如果我把SQL语句写在
“SQL语句”该怎么写???