如何正确declair在下面的代码的参数。即时得到的“的SelectCommand”下划线林不知道什么即时通讯做错了。 public int GetTotalNumberOfAprovedPictureIds(string SexType)
{
string strConectionString = ConfigurationManager.AppSettings["Data
此代码有效。它基于我在互联网上找到的一些代码。 你能告诉我,如果编码是获得标量值的最佳方法,并且如果有更好的方法可以显示编码样本吗? Dim objParentNameFound As Object
TextBoxParentsName.Text = ""
If TextBoxParentID.Text <> "" Then
' Display the parent's nam
我在ExecuteScalar()上收到错误消息。它说我必须声明标量变量@PicID。我怎么能声明一个标量变量?或者我不正确地完成整个功能? public int GetTotalNoVotes(int PicRating, int PicID)
{
//get database connection string from config file
string
我试图在标签中显示SQL查询结果,但没有显示。这是我的代码: string result = "SELECT ACTIVE FROM [dbo].[test] WHERE ID = '" + ID.Text + "' ";
SqlCommand showresult = new SqlCommand(result, conn);
conn.Open();
showr
我试图在下面的查询中返回成员标识。如果我运行查询就像查询我得到20,但是当我exectute代码它返回一个零。我在这里做错了什么? public int GetMemberID(string guid)
{
string strConectionString = ConfigurationManager.AppSettings["DataBaseConnection"];
首先将新成员插入到成员表中。然后,即时查询表以获取成员标识。我将数据输入到表格中,但没有足够快的速度在下面的行中进行查询。 我得到这个异常“ExecuteScalar需要一个开放和可用的连接,连接的当前状态是关闭的。”我无法弄清楚这里有什么不对。 //This code works fine
//Insert new members data
InsertMembers insert = ne