Click here to Skip to main content
15,887,294 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am using calendar date .this date select then radiobuttonlist in avialable radio button value is not display.only unavailable radio button value in database display.

select date in calendar then which value is available in database then display in radiobuttonlist .this value is exist then this radiobutton is disabled....plz help me...
Time:
10:00AM To 10:15AM
10:15AM To 10.30AM

What I have tried:

public void DataRad()
{
string q1 = "select * from Appointments_Details where ( DId='" + TextBox6.Text + "' and ADate='" + txtDate + "')";
SqlCommand cmd1 = new SqlCommand(q1, con);
con.Open();
dr = cmd1.ExecuteReader();
while(dr.Read())
{
Label7.Text = dr["ATime"].ToString();
}
Posted
Updated 9-Mar-16 6:02am
v2
Comments
Richard Deeming 9-Mar-16 9:32am    
Your code is vulnerable to SQL Injection[^].

NEVER use string concatenation to build a SQL query. ALWAYS use a parameterized query.
Member 12358714 9-Mar-16 11:55am    
Have you parameterized query code for select date then available value display in radiobuttonlist .....plz send...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900