Click here to Skip to main content
15,915,603 members
Home / Discussions / Database
   

Database

 
GeneralRe: Records are applied double Pin
Colin Angus Mackay27-Nov-04 14:49
Colin Angus Mackay27-Nov-04 14:49 
GeneralRe: Records are applied double Pin
realmontanakid29-Nov-04 11:07
realmontanakid29-Nov-04 11:07 
GeneralModifying a Column Pin
si_6926-Nov-04 4:09
si_6926-Nov-04 4:09 
GeneralRe: Modifying a Column Pin
Mike Dimmick26-Nov-04 4:43
Mike Dimmick26-Nov-04 4:43 
GeneralRe: Modifying a Column Pin
si_6926-Nov-04 4:56
si_6926-Nov-04 4:56 
QuestionCan anyone help me Pin
EshaKarthikeyan26-Nov-04 3:20
EshaKarthikeyan26-Nov-04 3:20 
AnswerRe: Can anyone help me Pin
David Salter26-Nov-04 4:50
David Salter26-Nov-04 4:50 
GeneralContents of TextBoxes assign to sqlString Pin
realmontanakid25-Nov-04 23:27
realmontanakid25-Nov-04 23:27 
Hi
I need some Help. I want to filter Records from one Table.
I got a new Form with two TextBoxes and one DataGrid. The
DataGrid shows the Results after Click on the Button named "Find".
One Textbox is for the DataBase ID. The other TextBox is for common
Text.
Now i need to assign the entered Text from the Textboxes to the sql String.
I hope you know what i mean cause my English is little bit bad sometimes.

I got the following Code and it works.. but how can i assign the text to the
sql Query? So it is static.

private void find ()
{
ds = new DataSet();
string ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=...


OleDbConnection conn = new OleDbConnection(ConnectionString);

OleDbCommand cmd = new OleDbCommand("SELECT * FROM tbl_Artikel WHERE ID =88 OR Hersteller LIKE 'Asus' OR Hersteller LIKE ''",conn);

dbAdapter = new OleDbDataAdapter(cmd);


dbAdapter.Fill(ds, "tbl_Artikel");

dataGrid1.DataSource = ds.Tables["tbl_Artikel"].DefaultView;
}



private void btFind_Click(object sender, System.EventArgs e)
{
find();
his.dataGrid1.AlternatingBackColor=Color.Wheat;

}
I tougt something like that, ("SELECT * FROM tbl_Artikel WHERE ID='"+this.textBoxID+"'",conn);
but it don't work furthermore i've heard this is no good solution.
What can I do???

GeneralRe: Contents of TextBoxes assign to sqlString Pin
Colin Angus Mackay26-Nov-04 0:35
Colin Angus Mackay26-Nov-04 0:35 
GeneralSession Data in SQL Server Pin
David Salter25-Nov-04 22:41
David Salter25-Nov-04 22:41 
QuestionHow to import data from different catalog via dts Pin
steven_wong25-Nov-04 21:14
steven_wong25-Nov-04 21:14 
GeneralBoolean Field Pin
Sebastien Lachance25-Nov-04 5:38
Sebastien Lachance25-Nov-04 5:38 
QuestionIs ObjectSpaces any good ? Pin
Andres Coder25-Nov-04 4:34
Andres Coder25-Nov-04 4:34 
GeneralQuestion on Dataset v.s DataReader Pin
HahnTech25-Nov-04 4:20
HahnTech25-Nov-04 4:20 
GeneralRe: Question on Dataset v.s DataReader Pin
Steven Campbell25-Nov-04 5:04
Steven Campbell25-Nov-04 5:04 
GeneralDataGrid in a second Form Pin
realmontanakid25-Nov-04 3:31
realmontanakid25-Nov-04 3:31 
GeneralRe: DataGrid in a second Form Pin
Edbert P25-Nov-04 15:50
Edbert P25-Nov-04 15:50 
Generalproblem running Sql Server as localhost Pin
Hmitosh25-Nov-04 1:55
Hmitosh25-Nov-04 1:55 
GeneralRe: problem running Sql Server as localhost Pin
Steve S25-Nov-04 4:58
Steve S25-Nov-04 4:58 
GeneralA question about Microsoft DataGrid Control, Version 6.0(OLEDB) Pin
IsaacLitingjun24-Nov-04 21:25
IsaacLitingjun24-Nov-04 21:25 
GeneralRestore DB Pin
Anonymous24-Nov-04 8:58
Anonymous24-Nov-04 8:58 
GeneralRe: Restore DB Pin
venadder24-Nov-04 10:52
venadder24-Nov-04 10:52 
GeneralAn exception caused by Primary Key Pin
sharonz24-Nov-04 1:59
sharonz24-Nov-04 1:59 
GeneralRe: An exception caused by Primary Key Pin
Colin Angus Mackay24-Nov-04 4:55
Colin Angus Mackay24-Nov-04 4:55 
GeneralAdd table, fields and records Pin
bouli23-Nov-04 17:05
bouli23-Nov-04 17:05 

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.