如何正確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