|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Parameter query problem
Hello
I am new to parameters..anybody knows parameter can be passed in correctly ? There are 2 table, "sp" is one of the table that will be used depending on a session. I need to pass a dropdownlist value into the query like: table123.ID = ddlItem.SelectedValue; GetLists(table123); Code:
public DataSet GetLists(table123 pref)
{
new SqlCommand("select b.ID2 from " + sp + " a, tb2 b where a.ID=b.ID and d.ID=@id", cn);
cm.Connection = cn;
cm.Parameters.Add(p1);
cm.Parameters[@id].Value = pref;
ds = new DataSet();
da = new SqlDataAdapter(cm);
da.Fill(ds, "GetLists");
return ds;
}
|
|
#2
|
|||
|
|||
|
Quote:
http://kirank.blog.com/2009/06/30/u...ries-in-aspnet/ hope this will helps u. Thank you.
__________________
if you found this post is useful click (right side on this reply ) and agreeCoding Stuffs, web development help Thank You, ![]() KiranK Last edited by markWilson : June 30th, 2009 at 05:14 AM. |
![]() |
| Viewing: ASP Free Forums > Programming > .NET Development > Parameter query problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|