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

From: Eric Renken (EricRRenken_at_newsgroup.nospam)
Date: 10/12/04


Date: Mon, 11 Oct 2004 23:07:21 -0400

That error sounds like your datatset that you are filling with the
adapter.Fill(ds) doesn't allow NULLS in one of the columns and one of your
columns is returning null. Make sure that the dataset column "Company Name"
with a space exists. It might not be exactly the same name so it is
inserting nulls into it for every Company ID.

-- 
Eric Renken
Demiuirge Software LLC
http://www.demiurge.us
"haiwen" <haiwen@discussions.microsoft.com> wrote in message 
news:F6B61208-D59B-426F-AF3A-0397FF3B562F@microsoft.com...
> 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
>>
>>
>>