F
franky
1- Does somebody know a Tool like Profiler for the SQL Server 2000. I woud
like to trace my query.
2- I have some bizard problem with simple query.
string query1 = "Select * from employee where employyeID = 147"
string query2 = "Select * from employee where Name= 'vicky'"
string query3 = "Select * from employee where employyeID = ?"
string query4 = "Select * from employee where Name= '?'"
Query 1, 2, 3 work fine.... but Query 4 return no record?!?!
______________________________________________________
this is all my code:
SqlCeConnection cn = new SqlCeConnection(ConnStr);
cn.Open();
SqlCeCommand oCmd = new SqlCeCommand(query4,cn);
SqlCeParameter p = new SqlCeParameter("@name", SqlDbType.NVarChar,10);
oCmd.Parameters.Add(p);
oCmd.Parameters["@name"].Value = txtparam1.Text;
oCmd.Prepare();
SqlCeDataAdapter oAdpater = new SqlCeDataAdapter(oCmd);
DataSet dtsTemp = new DataSet();
oAdpater.Fill(dtsTemp);
Datagrid1.DataSource = dtsTemp.Tables[0];
cn.Close();
Thanks
__________________________
Franky
(e-mail address removed)
like to trace my query.
2- I have some bizard problem with simple query.
string query1 = "Select * from employee where employyeID = 147"
string query2 = "Select * from employee where Name= 'vicky'"
string query3 = "Select * from employee where employyeID = ?"
string query4 = "Select * from employee where Name= '?'"
Query 1, 2, 3 work fine.... but Query 4 return no record?!?!
______________________________________________________
this is all my code:
SqlCeConnection cn = new SqlCeConnection(ConnStr);
cn.Open();
SqlCeCommand oCmd = new SqlCeCommand(query4,cn);
SqlCeParameter p = new SqlCeParameter("@name", SqlDbType.NVarChar,10);
oCmd.Parameters.Add(p);
oCmd.Parameters["@name"].Value = txtparam1.Text;
oCmd.Prepare();
SqlCeDataAdapter oAdpater = new SqlCeDataAdapter(oCmd);
DataSet dtsTemp = new DataSet();
oAdpater.Fill(dtsTemp);
Datagrid1.DataSource = dtsTemp.Tables[0];
cn.Close();
Thanks
__________________________
Franky
(e-mail address removed)