www.tursoft.net
tursoft@tursoft.net
Atom v1.0My Yahoo! hesabına ekleMy MSN hesabına ekle
Uğur Umutluoğlu
GEZEGENIEEE
Bilen YAVUZ
Typed Dataset Parameterized Query Error
 
While working on Visual Studio 2005 Typed Datasets, we (me and my friend Uğur Umutluoğlu) have faced a syntax error problem for parameterized queries.

The problem is the syntax of the datasource used for query. If you use SQL Server as a datasource, you should use @parameter_name syntax to define a parameter. However, for Access database, your should put ? for parameter definition.

Example;
SQL Server version :
SELECT * FROM Projeler WHERE
(proje_id = @projectID)

Ms Access version :
SELECT * FROM Projeler WHERE (
proje_id = ?)

Following text is taken from MSDN as it is;

Note
The syntax for parameter placeholders varies depending on the data source. This example shows placeholders for a SQL Server data source (@paramname). Use question mark (?) placeholders for System.Data.OleDb and System.Data.Odbc parameters (WHERE CompanyName like ?).


For further information:
http://msdn2.microsoft.com/en-us/library/wta78a9t.aspx
Salı, Eylül 12, 2006  @ 00:47 0 yorum var
Copyright (c) 2006 Muhammet TURŞAK - Tüm hakları saklıdır.