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
Guy
NA
3
10.3k
Cant get DataAdapter parameter to take C# string variable
Oct 5 2010 5:18 PM
Im trying to add a search box onto my winform. Im using SqlCE.
Im trying to get the sqlceDataAdapter to take a string variable, but when I press the button to search it tells my that the stored procedure is not valid, WHEN IT IS. Here is the code:
private void button1_Click(object sender, EventArgs e)
{
string search = "\"SELECT * FROM people\"";
con = new SqlCeConnection("Data Source = DBtest.sdf;Persist Security Info=False");
con.Open();
MessageBox.Show(con.State.ToString());
SqlCeDataAdapter a = new SqlCeDataAdapter(search, con);
DataTable t = new DataTable(); a.Fill(t); dataGridView1.DataSource = t;
}
}
Ideally I wanted to add a textbox where the user can type in a last name and it will search my database and display it.. My db is a SDF file..
Any help will be appreciated.
Reply
Answers (
2
)
Database Management Code
C# .net Oracle Regular Expressions