R
Rich
Dim da As New sqlDataAdapter
da.SelectCommand = New SqlCommand
da.SelectCommand.Connection = conn
da.Selectcommand.CommandText = "Select * From tbl1 Where fld1 = @P"
da.SelectCommand.Parameters.Add("@P", SqlDBtype.varchar, 50, "fld1")
da.SelectCommand.Parameters("@P").Value = txt1.Text
lets say that txt1.Text = "test"
Console.WriteLine(da.SelectCommand.CommandText)
-->returns
Select * From tbl1 Where fld1 = @P
Is it possible to debug.print the sql statement to return with the
Paramenter value?
Select * From tbl1 Where fld1 = 'test'
How to do this?
I am thinking something similar to
console.WriteLine("Select * From tbl1 Where {0}", param0")
my actual statement has several parameters.
thanks,
Rich
da.SelectCommand = New SqlCommand
da.SelectCommand.Connection = conn
da.Selectcommand.CommandText = "Select * From tbl1 Where fld1 = @P"
da.SelectCommand.Parameters.Add("@P", SqlDBtype.varchar, 50, "fld1")
da.SelectCommand.Parameters("@P").Value = txt1.Text
lets say that txt1.Text = "test"
Console.WriteLine(da.SelectCommand.CommandText)
-->returns
Select * From tbl1 Where fld1 = @P
Is it possible to debug.print the sql statement to return with the
Paramenter value?
Select * From tbl1 Where fld1 = 'test'
How to do this?
I am thinking something similar to
console.WriteLine("Select * From tbl1 Where {0}", param0")
my actual statement has several parameters.
thanks,
Rich