J
Jason
I have a dataadapter that I pass a sqlcommand to, which has paramters.
I have the following sqlcommand on my page:
SELECT *
FROM tbl_Changes
WHERE (CAST(@column1 AS nvarchar(20)) LIKE @Criteria1)
and have the following code to call this sqlcommand in my webpage:
cmdSelectNone.Parameters("@Column1").Value = "Change_Status"
cmdSelectNone.Parameters("@Criteria1").Value = "%" & txtSearchCriteria1.Text
& "%"
SqlDataAdapter2.SelectCommand = cmdSelectNone
SqlDataAdapter2.Fill(DsChanges2)
dgSearch.DataSource = DsChanges2
dgSearch.DataBind()
Every time I call the above code it returns no records, yet if I comment out
the '@column1' parameter in the code and hard code the column name in the
sqlcommand it works just fine.
Could anyone please tell me what's wrong with my
cmdSelectnone.Parameters("@Column1").value="Change_Status" line please??
Thanks in advance,
Jason
I have the following sqlcommand on my page:
SELECT *
FROM tbl_Changes
WHERE (CAST(@column1 AS nvarchar(20)) LIKE @Criteria1)
and have the following code to call this sqlcommand in my webpage:
cmdSelectNone.Parameters("@Column1").Value = "Change_Status"
cmdSelectNone.Parameters("@Criteria1").Value = "%" & txtSearchCriteria1.Text
& "%"
SqlDataAdapter2.SelectCommand = cmdSelectNone
SqlDataAdapter2.Fill(DsChanges2)
dgSearch.DataSource = DsChanges2
dgSearch.DataBind()
Every time I call the above code it returns no records, yet if I comment out
the '@column1' parameter in the code and hard code the column name in the
sqlcommand it works just fine.
Could anyone please tell me what's wrong with my
cmdSelectnone.Parameters("@Column1").value="Change_Status" line please??
Thanks in advance,
Jason