TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
eksypnos123
NA
65
0
passing a different sql string to DataAdapter each time i click a button
Oct 26 2004 2:00 PM
private void button1_Click(object sender, System.EventArgs e) { ds.Tables.Clear(); da.SelectCommand=new SqlCommand(textBox1.Text,sqlConnection1); da.Fill(ds,"myTable"); dataGrid1.SetDataBinding(ds,"myTable"); } I have a form with a textBox1, a dataGrid1 and a button1. In the textBox1 I write some sql code and I want to see the output in the grid. ds is a dataset and da is a dataAdapter that were instantiated once in the constructor without any parameters. (ds=new DataSet(), da=New DataAdapter()). My problems is that this code seems to execute only the first time I click the button. After the first time the datagrid doesn't change although i put different sql code in the textBox. Can somebody tell me why is this happening?
Reply
Answers (
3
)
data adapter does not update
SqlConnection...Please help!!