Home All Groups Group Topic Archive Search About

table adapter fill problem

Author
23 Jun 2006 1:39 AM
fanor
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

Author
23 Jun 2006 4:29 AM
Cor Ligthert [MVP]
>
> 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?ID=550279ec-6767-44ff-aaa3-eb8b44af0137

I hope this helps,

Cor
Author
23 Jun 2006 3:31 PM
Fanor
"Cor Ligthert [MVP]" <notmyfirstn***@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.
Author
23 Jun 2006 3:34 PM
Cor Ligthert [MVP]
Did you try the samples?

Show quote
"Fanor" <xreed2***@yahoo.com> schreef in bericht
news:%23%23MJQltlGHA.4196@TK2MSFTNGP03.phx.gbl...
>
> "Cor Ligthert [MVP]" <notmyfirstn***@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.
>
>
>

AddThis Social Bookmark Button