J
Jeff
ASP.NET 2.0
The select in the code below throws an exception when I tested it: Incorrect
syntax near 'f'
This is the select Debug.Write wrote to the output window:
SELECT Id, Info FROM Test where Id = f24a27c7-630f-411e-aac0-b571e8b440a6
public override TestInfo GetTest(System.Guid id)
{
using (SqlConnection cn = new SqlConnection(this.ConnectionString))
{
string sql = "SELECT Id, Info FROM Test where Id = " + id.ToString();
Debug.Write("sql = " + sql);
SqlCommand cmd = new SqlCommand(sql, cn);
cmd.CommandType = CommandType.Text;
cn.Open();
}
}
What am I doing wrong here?
Jeff
The select in the code below throws an exception when I tested it: Incorrect
syntax near 'f'
This is the select Debug.Write wrote to the output window:
SELECT Id, Info FROM Test where Id = f24a27c7-630f-411e-aac0-b571e8b440a6
public override TestInfo GetTest(System.Guid id)
{
using (SqlConnection cn = new SqlConnection(this.ConnectionString))
{
string sql = "SELECT Id, Info FROM Test where Id = " + id.ToString();
Debug.Write("sql = " + sql);
SqlCommand cmd = new SqlCommand(sql, cn);
cmd.CommandType = CommandType.Text;
cn.Open();
}
}
What am I doing wrong here?
Jeff