Click here to Skip to main content
15,908,445 members

Comments by jangojan (Top 6 by date)

jangojan 24-Feb-13 23:12pm View    
hie subham ,, but how can i do that , i hae already included the dll files in the bin folder,
jangojan 1-Feb-13 1:20am View    
ok i sendign you the cs page now
jangojan 1-Feb-13 0:41am View    
private void text_searchstring_TextChanged(object sender, EventArgs e)
{

}

private void button1_search_Click(object sender, EventArgs e)
{
string Name = comboBox1.SelectedText;
string txttosearch = text_searchstring.Text;
//string parameter = text_searchstring + comboBox1.SelectedItem.ToString();
//string parameter = text_searchstring.Text + comboBox1.SelectedText.ToString();
//errorProvider1.Dispose();
//if (.Text.Length == 0)
//if (text_searchstring.Text.Length == 0)
// errorProvider1.SetError(text_searchstring, "please fill name");

{
SqlConnection conn = new SqlConnection();
conn.ConnectionString = @"Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\jumbo\my documents\visual studio 2010\Projects\testingdatabase\testingdatabase\Database1.mdf;Integrated Security=True;User Instance=True";
conn.Open();
//SqlCommand cmd = new SqlCommand();
//cmd.Connection = conn;
//cmd = new SqlCommand("select * from Table where name like '%" + txtsearch.Text + "%'");
//cmd = new SqlCommand("select * from Table1 where name like '%" + text_searchstring.Text + "%'");
SqlDataAdapter adapter = new SqlDataAdapter("select * from Table1 where "+Name+" like '%" +txttosearch+ "%'" , conn);
DataTable dt = new DataTable();
//SqlDataAdapter adapter = new SqlDataAdapter();
adapter.Fill(dt);
dataGridView1.DataSource = dt;
dataGridView1.Visible = true;
//dataGridView1.DataSource = dt;
//dataGridView1.Visible = true;
conn.Close();
conn.Dispose();


this time the code is like this . . please correct the code
jangojan 1-Feb-13 0:36am View    
no it is not happening this time also, gives me no error, but when i input something in text box and select appropriate parameter from combobox the input in textbox disappear and press enter gives me error of sql adapter, so pleaase can you have look of code again,
jangojan 1-Feb-13 0:35am View    
no i dnt know bobby tables