Click here to Skip to main content
15,911,039 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: asp.net Pin
ThatsAlok13-Jun-06 1:55
ThatsAlok13-Jun-06 1:55 
JokeRe: asp.net Pin
Monty213-Jun-06 6:56
Monty213-Jun-06 6:56 
GeneralRe: asp.net Pin
Nish Nishant13-Jun-06 7:10
sitebuilderNish Nishant13-Jun-06 7:10 
GeneralRe: asp.net Pin
Chris Maunder13-Jun-06 11:05
cofounderChris Maunder13-Jun-06 11:05 
QuestionASP.NET Secure QueryString (Encrypt/Decrypt) Pin
Moe Tarhini12-Jun-06 23:55
Moe Tarhini12-Jun-06 23:55 
AnswerRe: ASP.NET Secure QueryString (Encrypt/Decrypt) Pin
Red_Wizard_Shot_The_Food13-Jun-06 6:33
Red_Wizard_Shot_The_Food13-Jun-06 6:33 
GeneralRe: ASP.NET Secure QueryString (Encrypt/Decrypt) Pin
Moe Tarhini13-Jun-06 19:32
Moe Tarhini13-Jun-06 19:32 
QuestionQuery Problem or Code Wrong --- Need Support !:confused: Pin
Vinay Chugh12-Jun-06 23:51
Vinay Chugh12-Jun-06 23:51 
Confused | :confused:
Hi guys !
I am trying to search my database with some value enterd by the user in a textbox.The search result has to be displayed in a ListBox on click of search button.

The problem is that when i use the LIKE predicate with 'A%' it gives all the values in ListBox but when i use LIKE predicate as LIKE '"+TextBox1.Text+"' the result is not shown and i get an error saying one or more Parameters are not given values.
PLease Please PLease Help me guys !

My code snippet is as follows:
void Search_Click(object Source, EventArgs e)
{
if (RadioButtonList1.SelectedIndex == 0)
{
// ....Intializing the Strings....//

tring connectionstring;
string queryString;

DataSet ds = new DataSet();
OleDbConnection dbconnection;
OleDbDataAdapter ad;
connectionstring = "Provider=Microsoft.Jet.OLeDb.4.0;DATA SOURCE=" +
Server.MapPath("\\Database\\New_Tool.mdb") ;
queryString = "SELECT Company_Name FROM CompanyName WHERE Company_Name LIKE '"TextBox1.Text"' ";


dbconnection = new OleDbConnection(connectionstring);
dbconnection.Open();
ad = new OleDbDataAdapter(queryString, dbconnection);

ad.Fill(ds,"Company_Name");

ListBox1.DataSource = ds;
ListBox1.DataTextField = "Company_Name";
ListBox1.DataValueField = "Company_Name";
ListBox1.DataBind();


}
}


Vinay Chugh
Newbie in ASP.NET
AnswerRe: Query Problem or Code Wrong --- Need Support !:confused: Pin
J4amieC13-Jun-06 0:02
J4amieC13-Jun-06 0:02 
GeneralRe: Query Problem or Code Wrong --- Need Support !:confused: Pin
Vinay Chugh13-Jun-06 21:17
Vinay Chugh13-Jun-06 21:17 
QuestionUpdating TextBox values to .txt File Pin
ravikiranreddydharmannagari12-Jun-06 23:45
ravikiranreddydharmannagari12-Jun-06 23:45 
AnswerRe: Updating TextBox values to .txt File Pin
Suamal13-Jun-06 0:11
Suamal13-Jun-06 0:11 
Questionprinter is attached or not in vb.net 1.1 Pin
sandeep_thakur12-Jun-06 23:20
sandeep_thakur12-Jun-06 23:20 
AnswerRe: printer is attached or not in vb.net 1.1 Pin
mnaveed13-Jun-06 0:39
mnaveed13-Jun-06 0:39 
QuestionWeb parts Pin
philpeters12-Jun-06 22:34
philpeters12-Jun-06 22:34 
QuestionRun time compilation error Pin
Sandeep Akhare12-Jun-06 22:33
Sandeep Akhare12-Jun-06 22:33 
QuestionPrinting Urgent Pin
Suamal12-Jun-06 22:32
Suamal12-Jun-06 22:32 
QuestionHow to call a codebehind function on onblur event?? Pin
kvPriya12-Jun-06 21:51
kvPriya12-Jun-06 21:51 
AnswerRe: How to call a codebehind function on onblur event?? Pin
Paddy Boyd12-Jun-06 21:56
Paddy Boyd12-Jun-06 21:56 
GeneralRe: How to call a codebehind function on onblur event?? Pin
kvPriya12-Jun-06 23:26
kvPriya12-Jun-06 23:26 
Questionmessage board Pin
shah zad12-Jun-06 21:34
shah zad12-Jun-06 21:34 
QuestionConfiguration Manager has no Release build Pin
desmondling7812-Jun-06 21:00
desmondling7812-Jun-06 21:00 
AnswerRe: Configuration Manager has no Release build Pin
Paddy Boyd12-Jun-06 21:57
Paddy Boyd12-Jun-06 21:57 
GeneralRe: Configuration Manager has no Release build Pin
desmondling7812-Jun-06 23:50
desmondling7812-Jun-06 23:50 
AnswerRe: Configuration Manager has no Release build Pin
Guffa13-Jun-06 2:20
Guffa13-Jun-06 2:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.