Re: Cannot define the DataMember in code

From: Mike Edenfield (kutulu_at_not.kutulu.not.org)
Date: 10/27/04


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



Relevant Pages

  • Re: FBOFW, 1-10
    ... >> and have any success at all. ... >> just a competing fantasy about how freelancing works. ... > Either Mike does ... didn't want it, knowing his career was at a critical juncture, knowing ...
    (rec.arts.comics.strips)
  • Re: Question about dual headset for re-dictating using VR
    ... > frustation of having a set of earplus plus the mike ... > out the window, hence I've always gone back to the keyboard and expanders, ... > Does anyone know if a dual purpose headset has been created. ... > I'd also love to hear from anyone who is having success with VR and ...
    (sci.med.transcription)
  • Re: msado27.tlb has missing dependency info
    ... > Thanks very much, Mike, for your swift answer. ... It pretty much explains .dep files. ... But if you're up against a deadline and you don't think ... success, ...
    (microsoft.public.vb.general.discussion)
  • Re: Eduardo - fellow IBOC-shill diputes your claims about AM ratings.
    ... I am leaving this confusing exchange. ... Interesting that you should note that, mike. ... DP, when cornered, seems to give cryptic, confusing and out of context responses. ... maybe an ultrasound scan of his carotid arteries would be in order. ...
    (rec.radio.shortwave)
  • Re: Cant start OE redux
    ... HKCU/Identities key, without success. ... As far as the DBX files, ... I checked all hidden and system files. ... Mike ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)

Quantcast