| Sign In/My Account | View Cart |
| Article: |
Transparent Database Access with ADO.NET | |
| Subject: | Parameters | |
| Date: | 2003-02-05 19:41:27 | |
| From: | anonymous2 | |
|
Oracle and SQLServer data providers have a different way to specify parameter markers in sentences:
|
||
Showing messages 1 through 2 of 2.
private const string SQL_GET_RECORD = "SELECT * FROM UserTbl WHERE id = {0} AND name='{1}'";
You can format your string like this:
String.Format(SQL_GET_RECORD_BY_ID,123,'jesse');
This will produce the following string:
SELECT * FROM UserTbl WHERE id = 123 AND name='jesse'
Hope it helps,
Jesse