Re: Cannot define the DataMember in code
From: Mike Edenfield (kutulu_at_not.kutulu.not.org)
Date: 10/27/04
- Next message: Kuba: "Re: what version of MDAC do I have?"
- Previous message: A Traveler: "Re: Tools for Oracle??"
- In reply to: Douglas Buchanan: "Re: Cannot define the DataMember in code"
- Next in thread: Douglas Buchanan: "Re: Cannot define the DataMember in code"
- Reply: Douglas Buchanan: "Re: Cannot define the DataMember in code"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 27 Oct 2004 10:00:23 -0400
Douglas Buchanan wrote:
> Mike,
>
> Thank you for your suggestions. I have tried them with no success.
>
> Below is my entire code in context (less designer generated code).
> Below is also the error messages from my catch statement.
> With daAuthor.SelectCommand
> .CommandText = "Select * from authors"
> .Connection = cnPubs
> With .Parameters
> .Add("@au_ID", SqlDbType.Char, 11, "au_ID")
> .Add("@au_lname", SqlDbType.VarChar, 40, "au_lname")
> .Add("@au_fname", SqlDbType.VarChar, 20, "au_fname")
> .Add("@phone", SqlDbType.Char, 12, "phone")
> .Add("@address", SqlDbType.VarChar, 40, "address")
> .Add("@city", SqlDbType.VarChar, 20, "city")
> .Add("@state", SqlDbType.Char, 2, "state")
> .Add("@zip", SqlDbType.Char, 5, "zip")
> .Add("@contract", SqlDbType.Bit, 1, "contract")
> End With
> End With
This part is the problem. Your SelectCommand does not have parameters.
You are adding paramters that aren't going to be filled in when the
SQL runs, so the server won't know what to do. Since you don't have any
parameters in your CommandText (it's not a stored proc and has no
parameter placeholders) don't add any to it's Parameters collection.
--Mike
- Next message: Kuba: "Re: what version of MDAC do I have?"
- Previous message: A Traveler: "Re: Tools for Oracle??"
- In reply to: Douglas Buchanan: "Re: Cannot define the DataMember in code"
- Next in thread: Douglas Buchanan: "Re: Cannot define the DataMember in code"
- Reply: Douglas Buchanan: "Re: Cannot define the DataMember in code"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|