Re: how to select or update data when column name has space

From: haiwen (haiwen_at_discussions.microsoft.com)
Date: 10/11/04


Date: Mon, 11 Oct 2004 13:39:08 -0700

Hello, Ryan:

Thanks for your reply. I used it, such as:
s="select [Company name],CompanyID from companies order by CompanyID asc";
OleDbDataAdapter adapter=new OleDbDataAdapter(s,con);

adapter.Fill(ds);

But I always get follow exception:

System.Data.OleDb.OleDbException: No value given for one or more required
parameters.

what's wrong I have done?
Sincerely,

haiwen
"W.G. Ryan eMVP" wrote:

> use [Company Name]
>
> --
> W.G. Ryan, MVP
>
> www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
> "haiwen" <haiwen@discussions.microsoft.com> wrote in message
> news:9169E853-AB4A-42DE-BE55-17C8C986FBD0@microsoft.com...
> > Hello, everyone:
> >
> > I am writing an ado.net componet in c# to fetch data from MS Acess
> database.
> >
> > I got a problem is some table has column with space, such as "company
> name",
> >
> > Could anyone tell me how to select this kind of column?
> >
> > sincerely,
> >
> > haiwen
>
>
>



Relevant Pages

  • How do I fetch data ?
    ... After an insert in my database using a OleDbDataAdapter, how can I fetch ... I need to fecth data because when I don't have any data in one of my table ... It don't give me any exception if I had a record before I fill my ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: DataSet to excel?
    ... Ryan eMVP" wrote: ... Then use the OleDbDataAdapter to Update it - the connection string ... >> What is the most efficient way of transforming DataSet to excel ...
    (microsoft.public.dotnet.general)
  • Re: Cannot initialize OleDbDataReader object
    ... using the OleDBDataAdapter instead of the reader with this code: ... the next thing it does is throw an exception. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Cannot initialize OleDbDataReader object
    ... > using the OleDBDataAdapter instead of the reader with this code: ... the next thing it does is throw an exception. ...
    (microsoft.public.dotnet.languages.vb)