PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET table adapter fill problem

Reply

table adapter fill problem

 
Thread Tools Rate Thread
Old 23-06-2006, 02:39 AM   #1
fanor
Guest
 
Posts: n/a
Default table adapter fill problem


i have a table with a GetData(Param1) method that has this select

SELECT empid, firstname, lastname
FROM employees
WHERE (empid NOT IN
(SELECT empid
FROM WorkOn
WHERE (job = ?)))

in a form I want to fill it like this

......................

System.Data.OleDb.OleDbParameter mypar= new
System.Data.OleDb.OleDbParameter();

if (MNjob > 0)

{

mypar.Value= MNjob; // MNjob is int

this.workEmpTA.FillByJob(this.dBCCmangrDataSet.WorkEmp, MNjob);

this.empAvailTA.Fill(this.dBCCmangrDataSet.EmpAvail,mypar); // HERE THE
ERROR

}

............................

empAvailTA is the table adapter

What is wrong with mypar???



I'm using VS2005



TIA


  Reply With Quote
Old 23-06-2006, 05:29 AM   #2
Cor Ligthert [MVP]
Guest
 
Posts: n/a
Default Re: table adapter fill problem

>
> this.empAvailTA.Fill(this.dBCCmangrDataSet.EmpAvail,mypar); // HERE THE
> ERROR
>

What does this code mean?
The second parameter is AFAIK the Table name

Have a look at the this sample on our webpage

http://www.vb-tips.com/dbPages.aspx...a3-eb8b44af0137

I hope this helps,

Cor


  Reply With Quote
Old 23-06-2006, 04:31 PM   #3
Fanor
Guest
 
Posts: n/a
Default Re: table adapter fill problem


"Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message
news:%232PAm1nlGHA.3588@TK2MSFTNGP02.phx.gbl...
> >
>> this.empAvailTA.Fill(this.dBCCmangrDataSet.EmpAvail,mypar);

> What does this code mean?


Is to populate the EmpAvail table and mypar is the parameter that is causing
the error.



  Reply With Quote
Old 23-06-2006, 04:34 PM   #4
Cor Ligthert [MVP]
Guest
 
Posts: n/a
Default Re: table adapter fill problem

Did you try the samples?

"Fanor" <xreed2000@yahoo.com> schreef in bericht
news:%23%23MJQltlGHA.4196@TK2MSFTNGP03.phx.gbl...
>
> "Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message
> news:%232PAm1nlGHA.3588@TK2MSFTNGP02.phx.gbl...
>> >
>>> this.empAvailTA.Fill(this.dBCCmangrDataSet.EmpAvail,mypar);

>> What does this code mean?

>
> Is to populate the EmpAvail table and mypar is the parameter that is
> causing the error.
>
>
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off