我正在編寫登錄腳本,無法讓Convert.ToInt32()
爲我工作。ASP.NET登錄,Convert.ToInt32();
的錯誤:錯誤
'System.Convert.ToInt32(object)' is a 'method' but is used like a 'type'
片段:
con.Open();
string mysql; // generate an sql insert query for the database
mysql = "SELECT * FROM [Users] UserName='" + tbUser.Text + "'";
OleDbCommand CheckUser = new OleDbCommand(mysql, con);
int temp = new Convert.ToInt32(CheckUser.ExecuteScalar().ToString());
得到任何幫助。
你嘗試過'(int32)CheckUser.ExecuteScalar();'? – 2013-05-10 13:25:27
呵呵看一下sql注入攻擊... – 2013-05-10 13:36:13