Reputation: 51
I want to write following code in textbox key press event.
{
Loc = Server.MapPath("App_Data\\State.mdb");
string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Loc + ";";
DataSet ds = new DataSet();
OleDbConnection conn = new OleDbConnection(connectionString);
conn.Open();
OleDbCommand cmd = new OleDbCommand();
cmd.Connection = conn;
query = "Select * from MyCity";
OleDbDataAdapter adp = new OleDbDataAdapter(query, conn);
adp.Fill(ds);
Repeater1.DataSource = ds;
Repeater1.DataBind();
conn.Close();
}
I have google 100 times and find many code regarding generating textbox key press event and they all do good but iam unable to associate the above code with textbox keypress event.Also the above code is written in .aspx.cs* file.
If any one can write the above code in .aspx file, that will also be a great help.
Any help is a great help....Many thanks.....
Upvotes: 0
Views: 1216
Reputation: 3965
You need to use different technologies:
Please read this question in SO: how to write immediately search (c#)
Upvotes: 1