Click here to Skip to main content
15,902,447 members

Comments by engnoshi (Top 13 by date)

engnoshi 6-Jun-11 12:21pm View    
Got it my bad, thanks. it works great.
engnoshi 6-Jun-11 12:16pm View    
Tried it and gave me error, Object reference not set to an instance of an object.

DataRepeaterItem currItem;
for (int i = 0; i < dataRepeater1.ItemCount; i++)
{
dataRepeater1.CurrentItemIndex = i;
currItem = dataRepeater1.CurrentItem;


string QID = currItem.Controls["QID"].Text;
engnoshi 6-Jun-11 7:20am View    
Figured it out, that was because i bound it before with the designer and now manually, removed the designer and it works great.
engnoshi 6-Jun-11 7:15am View    
private void NewSurvey_Load(object sender, EventArgs e)
{

SqlCommand cmd = new SqlCommand("Select * from surveyQuestions", con);
SqlDataAdapter adapt = new SqlDataAdapter(cmd);
DataTable questions = new DataTable();
adapt.Fill(questions);


QIDLbl.DataBindings.Add("Text", questions, "QID");

dataRepeater1.DataSource = questions;

}
engnoshi 6-Jun-11 7:14am View    
Thanks a lot, I tried it and gave me a weird error though :
This causes two bindings in the collection to bind to the same property.
Parameter name: binding

Note that i have this code in the page load and that my database that am testing with has two rows only.