Click here to Skip to main content
15,896,269 members
Home / Discussions / C#
   

C#

 
QuestionHow do you dynamically assign a datagrid's headers in c#? Pin
Xarzu1-Aug-11 15:05
Xarzu1-Aug-11 15:05 
QuestionHow to work with generic date format Pin
Gali19781-Aug-11 9:58
Gali19781-Aug-11 9:58 
AnswerRe: How to work with generic date format Pin
#realJSOP1-Aug-11 12:01
professional#realJSOP1-Aug-11 12:01 
AnswerRe: How to work with generic date format Pin
Luc Pattyn1-Aug-11 12:47
sitebuilderLuc Pattyn1-Aug-11 12:47 
GeneralRe: How to work with generic date format Pin
Dalek Dave1-Aug-11 12:49
professionalDalek Dave1-Aug-11 12:49 
GeneralRe: How to work with generic date format Pin
Luc Pattyn1-Aug-11 12:51
sitebuilderLuc Pattyn1-Aug-11 12:51 
GeneralRe: How to work with generic date format Pin
PIEBALDconsult1-Aug-11 14:42
mvePIEBALDconsult1-Aug-11 14:42 
AnswerRe: How to work with generic date format Pin
Luc Pattyn1-Aug-11 15:04
sitebuilderLuc Pattyn1-Aug-11 15:04 
I am assuming you mean the following would be good:
string SQL="UPDATE tableName SET anInt=@anInt, aString=@aString, anotherInt=@anInt, aDate=@aDate WHERE ..."
OleDbCommand cmd=new OleDbCommand(...);
cmd.Parameters.Add("@anInt", OleDbType.Int).Value=12;
cmd.Parameters.Add("@aString", OleDbType.VarChar).Value="abc";
// no need to give the third parameter as it re-uses the first one
cmd.Parameters.Add("@aDate", OleDbType.Date).Value=DateTime.Today;

as the parameters are given in the order of first use.

But then that limitation seems pretty weird, as now they use parameter names to handle duplicate uses, but not for general parameter identification? That doesn't make much sense to me. If they would use names all the way (not hard at all), it would work like T-SQL and others!?

Maybe it depends on the OleDb version, where older ones need "?" and newer ones do it the proper way? Just guessing. Do you have any reference?

Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum

GeneralRe: How to work with generic date format Pin
PIEBALDconsult1-Aug-11 19:07
mvePIEBALDconsult1-Aug-11 19:07 
AnswerRe: How to work with generic date format [modified] Pin
Luc Pattyn1-Aug-11 15:21
sitebuilderLuc Pattyn1-Aug-11 15:21 
GeneralRe: How to work with generic date format Pin
Peter_in_27801-Aug-11 16:30
professionalPeter_in_27801-Aug-11 16:30 
GeneralRe: How to work with generic date format Pin
Luc Pattyn1-Aug-11 16:55
sitebuilderLuc Pattyn1-Aug-11 16:55 
GeneralRe: How to work with generic date format Pin
PIEBALDconsult1-Aug-11 19:08
mvePIEBALDconsult1-Aug-11 19:08 
GeneralRe: How to work with generic date format Pin
Luc Pattyn2-Aug-11 1:34
sitebuilderLuc Pattyn2-Aug-11 1:34 
GeneralRe: How to work with generic date format Pin
PIEBALDconsult2-Aug-11 3:12
mvePIEBALDconsult2-Aug-11 3:12 
AnswerRe: How to work with generic date format Pin
Luc Pattyn2-Aug-11 16:58
sitebuilderLuc Pattyn2-Aug-11 16:58 
GeneralRe: How to work with generic date format Pin
PIEBALDconsult2-Aug-11 17:47
mvePIEBALDconsult2-Aug-11 17:47 
GeneralRe: How to work with generic date format Pin
PIEBALDconsult2-Aug-11 18:39
mvePIEBALDconsult2-Aug-11 18:39 
AnswerRe: How to work with generic date format Pin
Luc Pattyn3-Aug-11 4:41
sitebuilderLuc Pattyn3-Aug-11 4:41 
GeneralRe: How to work with generic date format Pin
PIEBALDconsult3-Aug-11 16:22
mvePIEBALDconsult3-Aug-11 16:22 
GeneralRe: How to work with generic date format Pin
Luc Pattyn3-Aug-11 16:59
sitebuilderLuc Pattyn3-Aug-11 16:59 
GeneralRe: How to work with generic date format [modified] Pin
PIEBALDconsult3-Aug-11 18:44
mvePIEBALDconsult3-Aug-11 18:44 
GeneralRe: How to work with generic date format Pin
Richard Deeming11-Jan-12 5:44
mveRichard Deeming11-Jan-12 5:44 
QuestionRegEx with < or > Pin
econner1-Aug-11 9:55
econner1-Aug-11 9:55 
AnswerRe: RegEx with Pin
PIEBALDconsult1-Aug-11 14:45
mvePIEBALDconsult1-Aug-11 14:45 

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.