Click here to Skip to main content
15,886,806 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: step by step how to upload sql server database on webserver Pin
Not Active21-Oct-11 2:11
mentorNot Active21-Oct-11 2:11 
Questionhow to sepeate all list Pin
poonam jagdale21-Oct-11 1:19
poonam jagdale21-Oct-11 1:19 
AnswerRe: how to sepeate all list Pin
Not Active21-Oct-11 2:08
mentorNot Active21-Oct-11 2:08 
Questionuser authentication in asp.net Pin
Member 829494421-Oct-11 0:24
Member 829494421-Oct-11 0:24 
AnswerRe: user authentication in asp.net Pin
JacquesDP25-Oct-11 10:49
JacquesDP25-Oct-11 10:49 
QuestionInvalid postback or callback argument Pin
Amit Spadez20-Oct-11 20:37
professionalAmit Spadez20-Oct-11 20:37 
AnswerRe: Invalid postback or callback argument Pin
jkirkerx28-Oct-11 20:18
professionaljkirkerx28-Oct-11 20:18 
Questionpass values to 2010 control Pin
dcof20-Oct-11 12:19
dcof20-Oct-11 12:19 
I am adding a checkboxlist control to a C# asp.net 2010 since I am new to working with web pages. The following code works if I hardcode the value in the where clause. However, I want to pass the value in the where clause as a paramter. Thus can you tell me what I could change in the code below to pass the value to the where statement not as a hardcoded value?

[^]DBConnection.FillAttChkListBox(ChkBoxLstPlan, "Hnumber", "Hnumber",
DBConnection.ExecuteQuery("select p.Hnumber from dbo.Org o inner join Pl p on o.OrganizationID =p.OrganizationID where OrganizationName='orgname1'"), false);



public static DataTable ExecuteQuery(string SQLstring)
{
string constr = ConfigurationManager.ConnectionStrings["DBConnectionString"].ConnectionString;
//string constr = ConfigurationManager.ConnectionStrings["Client_ServiceConnectionString"].ConnectionString;
SqlConnection conn = new SqlConnection(constr);
DataTable dt = new DataTable("tbl");

using (conn)
{
conn.Open();
SqlCommand comm = new SqlCommand(SQLstring, conn);
comm.CommandTimeout = 0;
SqlDataAdapter da = new SqlDataAdapter(comm);
da.Fill(dt);
}

return dt;
}


public static void FillAttChkListBox(CheckBoxList chklistBox, String dataValueField, string dataTextField, DataTable dataTbl, bool bHasBlank)
{
chklistBox.DataTextField = dataTextField;
chklistBox.DataValueField = dataValueField;
chklistBox.DataSource = dataTbl;
chklistBox.DataBind();

if (bHasBlank)
{
chklistBox.Items.Insert(0, new ListItem());
// chklistBox.Items.Insert(1, new ListItem("All"));
}
}[^]
AnswerRe: pass values to 2010 control Pin
Ibrahim Hebish22-Oct-11 2:45
Ibrahim Hebish22-Oct-11 2:45 
GeneralRe: pass values to 2010 control Pin
umeshdwivedi kanpur23-Oct-11 4:55
umeshdwivedi kanpur23-Oct-11 4:55 
GeneralRe: pass values to 2010 control Pin
Ibrahim Hebish23-Oct-11 23:07
Ibrahim Hebish23-Oct-11 23:07 
QuestionSend pdfs directly tro printer. Pin
vanikanc20-Oct-11 9:16
vanikanc20-Oct-11 9:16 
AnswerRe: Send pdfs directly tro printer. Pin
Richard MacCutchan20-Oct-11 21:31
mveRichard MacCutchan20-Oct-11 21:31 
QuestionJavascript Function not working in asp.net page Pin
Cyber_guY20-Oct-11 5:13
Cyber_guY20-Oct-11 5:13 
AnswerRe: Javascript Function not working in asp.net page Pin
Dennis E White20-Oct-11 5:53
professionalDennis E White20-Oct-11 5:53 
GeneralRe: Javascript Function not working in asp.net page Pin
Cyber_guY20-Oct-11 23:57
Cyber_guY20-Oct-11 23:57 
QuestionHuman Testing Pin
#realJSOP20-Oct-11 3:27
mve#realJSOP20-Oct-11 3:27 
AnswerRe: Human Testing Pin
jesarg20-Oct-11 5:29
jesarg20-Oct-11 5:29 
GeneralRe: Human Testing Pin
#realJSOP20-Oct-11 7:43
mve#realJSOP20-Oct-11 7:43 
GeneralRe: Human Testing Pin
jesarg20-Oct-11 8:19
jesarg20-Oct-11 8:19 
GeneralRe: Human Testing Pin
#realJSOP20-Oct-11 10:13
mve#realJSOP20-Oct-11 10:13 
GeneralRe: Human Testing Pin
jesarg20-Oct-11 10:59
jesarg20-Oct-11 10:59 
GeneralRe: Human Testing Pin
#realJSOP20-Oct-11 12:15
mve#realJSOP20-Oct-11 12:15 
QuestionMembership.ValidateUser port to user tables Pin
nitin_ion19-Oct-11 19:19
nitin_ion19-Oct-11 19:19 
AnswerRe: Membership.ValidateUser port to user tables Pin
Brij19-Oct-11 20:13
mentorBrij19-Oct-11 20:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.