Click here to Skip to main content
16,015,296 members
Home / Discussions / Database
   

Database

 
AnswerRe: I want help on Sql query Pin
dotnetSong10-Jun-07 12:20
dotnetSong10-Jun-07 12:20 
QuestionSql query Pin
Parameswar Mal10-Jun-07 1:10
Parameswar Mal10-Jun-07 1:10 
AnswerRe: Sql query Pin
Colin Angus Mackay10-Jun-07 1:43
Colin Angus Mackay10-Jun-07 1:43 
AnswerRe: Sql query Pin
Arun.Immanuel10-Jun-07 15:28
Arun.Immanuel10-Jun-07 15:28 
QuestionCheck other open connections Pin
Joe Smith IX9-Jun-07 23:57
Joe Smith IX9-Jun-07 23:57 
AnswerRe: Check other open connections Pin
Mike Dimmick10-Jun-07 0:12
Mike Dimmick10-Jun-07 0:12 
QuestionDocumentation tool for SQl SERVER DATABASE Pin
xbiplav9-Jun-07 17:57
xbiplav9-Jun-07 17:57 
QuestionI can't execute an ms access query in Ado .net ? :( Pin
Hamed Musavi9-Jun-07 4:01
Hamed Musavi9-Jun-07 4:01 
Here's what I do:

strProcName = name of the query in access that works fine in access itself.
using (OdbcConnection cnn = new OdbcConnection("Dsn=LclPMedicHist;"))
{
    using (OdbcCommand cmd = new OdbcCommand (strProcName, cnn))
    {
        cmd.CommandType = CommandType.StoredProcedure;
        OdbcParameter prm;

        prm = new OdbcParameter("szName", OdbcType.NText, 50);
        prm.Value = Name;
        cmd.Parameters.Add(prm);

        ....

        cnn.Open();
        cmd.ExecuteNonQuery();
    }
}


ExecuteNonQuery() throws an exception:
An unhandled exception of type 'System.Data.Odbc.OdbcException' occurred in System.Data.dll

Additional information: ERROR [42000] [Microsoft][ODBC Microsoft Access Driver] Invalid SQL 
statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'.


I've even tried to use "?" as parameters names, or put "PROCEDURE " directly before query name. It didn't work. Can any one help me please? I'm really a newbie in C# and .Net.
AnswerRe: I can't execute an ms access query in Ado .net ? :( Pin
Paul Conrad9-Jun-07 5:57
professionalPaul Conrad9-Jun-07 5:57 
GeneralRe: I can't execute an ms access query in Ado .net ? :( Pin
Hamed Musavi10-Jun-07 0:20
Hamed Musavi10-Jun-07 0:20 
QuestionSQL query Pin
webhay9-Jun-07 0:35
webhay9-Jun-07 0:35 
AnswerRe: SQL query Pin
P_pk9-Jun-07 1:38
P_pk9-Jun-07 1:38 
AnswerRe: SQL query Pin
Krish - KP9-Jun-07 2:14
Krish - KP9-Jun-07 2:14 
GeneralRe: SQL query Pin
webhay9-Jun-07 2:27
webhay9-Jun-07 2:27 
GeneralRe: SQL query Pin
Krish - KP9-Jun-07 3:32
Krish - KP9-Jun-07 3:32 
QuestionLocal databse Pin
maksim3108-Jun-07 16:38
maksim3108-Jun-07 16:38 
AnswerRe: Local databse Pin
Sathesh Sakthivel8-Jun-07 16:44
Sathesh Sakthivel8-Jun-07 16:44 
AnswerRe: Local databse Pin
Expert Coming8-Jun-07 22:29
Expert Coming8-Jun-07 22:29 
GeneralRe: Local databse Pin
maksim3109-Jun-07 9:37
maksim3109-Jun-07 9:37 
QuestionConnect to server Pin
emiralp8-Jun-07 10:36
emiralp8-Jun-07 10:36 
AnswerRe: Connect to server Pin
Expert Coming8-Jun-07 22:37
Expert Coming8-Jun-07 22:37 
QuestionRe: Connect to server [modified] Pin
emiralp8-Jun-07 23:04
emiralp8-Jun-07 23:04 
AnswerRe: Connect to server Pin
Paul Conrad9-Jun-07 11:03
professionalPaul Conrad9-Jun-07 11:03 
QuestionCRecordset for multi-table recordsets Pin
paulosuckow8-Jun-07 8:28
paulosuckow8-Jun-07 8:28 
Questiontop rows Pin
vasini8-Jun-07 7:30
vasini8-Jun-07 7:30 

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.