Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void searchTheDB()
- {
- try
- {
- SqlConnection forSearch = new SqlConnection("Data Source=JAMES-PC;Initial Catalog=bitVerify;Integrated Security=True");
- SqlDataAdapter search = new SqlDataAdapter("SELECT compName As 'Company/Organization Name', btcAddr As 'Bitcoin Address', Premium_User as 'Premium User', upvote as 'Upvotes',downvote As 'Downvotes' FROM clientDataTable WHERE compName LIKE '%" + searchBox.Text + "%'", forSearch);
- DataSet dB = new DataSet();
- search.Fill(dB);
- searchGridView.DataSource = dB;
- searchGridView.DataBind();
- searchBox.Text = String.Empty;
- }
- catch (SqlException exp)
- {
- throw new InvalidOperationException("Sorry, the website is experiencing difficulties, please try again, error: ", exp);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement