Click here to Skip to main content
16,009,057 members
Home / Discussions / C#
   

C#

 
GeneralRe: popup menu in C# Pin
J. Dunlap5-Oct-03 18:16
J. Dunlap5-Oct-03 18:16 
GeneralRe: popup menu in C# Pin
zecodela5-Oct-03 18:24
zecodela5-Oct-03 18:24 
GeneralRe: popup menu in C# Pin
J. Dunlap5-Oct-03 18:31
J. Dunlap5-Oct-03 18:31 
GeneralRe: popup menu in C# Pin
J. Dunlap5-Oct-03 18:33
J. Dunlap5-Oct-03 18:33 
GeneralRe: popup menu in C# Pin
Corinna John5-Oct-03 20:31
Corinna John5-Oct-03 20:31 
GeneralRe: popup menu in C# Pin
Blake Coverett5-Oct-03 21:54
Blake Coverett5-Oct-03 21:54 
GeneralSQL/C# Pin
Harry20005-Oct-03 12:18
Harry20005-Oct-03 12:18 
GeneralRe: SQL/C# Pin
mistery225-Oct-03 13:41
mistery225-Oct-03 13:41 
SELCT FirtName, LastName, ID,From Coustomer WHERE FirstName LIKE '[A-Z]'
SELECT FirstName, LastName, ID FROM Customer WHERE FirstName LIKE ???

??? = I don't see what you want to do here. This is sure no SQL the like operater only allows to use wildcards % and _.

assume next records in DB:
cat
C#
dog
bat
faster

LIKE 'c%' returns cat and C#
LIKE 'c_' returns C#
LIKE '_a_' returns cat and bat
LIKE '_a%' returns cat, bat and faster

% for a range of caracters
_ for just 1 character

Let know what you want and I'll help you with the statement Smile | :)




Try this class named mySQL_Data with method get dataSet. (example with mysql)

public mySQL_Data(string userName, string database, string password, string host)
{
// constructor logic
this.userName = userName;
this.database = database;
this.password = password;
this.host = host;

conString = "DRIVER={MySQL ODBC 3.51 Driver};" + //place here the driver name like you
"SERVER="+host+";" + //find in Windows ODBC description
"DATABASE="+database+";" +
"UID="+userName+";" +
"PASSWORD="+password+";" +
"OPTION=3";
}

public override DataSet getDataSet(string query, string table)
{
OdbcConnection conn = new OdbcConnection(conString);
DataSet ds = new DataSet("name");
try
{
conn.Open();
OdbcDataAdapter da = new OdbcDataAdapter (query, conn);
da.Fill(ds, table);
conn.Close();
}
catch(OdbcException odbcError)
{
MessageBox.Show(
"Native: " + odbcError.Errors[0].NativeError.ToString() + "\n" +
"SQLState: " + odbcError.Errors[0].SQLState.ToString() + "\n" +
"Message: " + odbcError.Errors[0].Message,"ODBC Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
return ds;
}

greetz
GeneralRe: SQL/C# Pin
Mike Ellison5-Oct-03 14:16
Mike Ellison5-Oct-03 14:16 
GeneralRe: SQL/C# Pin
Harry20005-Oct-03 17:28
Harry20005-Oct-03 17:28 
GeneralRe: SQL/C# Pin
mistery226-Oct-03 0:13
mistery226-Oct-03 0:13 
GeneralDB IV .DBF Databases Pin
gmhanna5-Oct-03 9:33
gmhanna5-Oct-03 9:33 
GeneralRe: DB IV .DBF Databases Pin
Randhir Sinha6-Oct-03 2:05
Randhir Sinha6-Oct-03 2:05 
GeneralRuntime Object state. Pin
Anonymous5-Oct-03 8:39
Anonymous5-Oct-03 8:39 
GeneralRe: Runtime Object state. Pin
Blake Coverett5-Oct-03 10:31
Blake Coverett5-Oct-03 10:31 
Questionprinter minimum margins?? Pin
mistery225-Oct-03 7:59
mistery225-Oct-03 7:59 
AnswerRe: printer minimum margins?? Pin
Nick Parker5-Oct-03 9:29
protectorNick Parker5-Oct-03 9:29 
GeneralRe: printer minimum margins?? Pin
mistery225-Oct-03 12:04
mistery225-Oct-03 12:04 
GeneralDataGrid and multiple threads Pin
ke5in5-Oct-03 5:32
ke5in5-Oct-03 5:32 
Questionwhich one is faster? Pin
abc8764-Oct-03 13:07
abc8764-Oct-03 13:07 
AnswerRe: which one is faster? Pin
J. Dunlap4-Oct-03 13:41
J. Dunlap4-Oct-03 13:41 
GeneralRe: which one is faster? Pin
leppie4-Oct-03 23:49
leppie4-Oct-03 23:49 
GeneralRe: which one is faster? Pin
J. Dunlap5-Oct-03 9:46
J. Dunlap5-Oct-03 9:46 
GeneralRe: which one is faster? Pin
leppie5-Oct-03 13:36
leppie5-Oct-03 13:36 
GeneralRe: which one is faster? Pin
J. Dunlap5-Oct-03 13:56
J. Dunlap5-Oct-03 13:56 

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.