dovk179
asked on
insert into table
In mala2DataSet1.xsd
I have a select query with the executeMod Reader, FillMethodName Fillby_Cod and GetMethodname GetDataBy_cod
in order to populate a DataGridvalue with the cod or heigher number I called:
Me.AnuncTableAdapter.FillB y_cod(Me.M ala2DataSe t1.Anunc, vcod) and it works fine
I have to add a row to a table named "anunc" and populate only the codint field.
With a select query I created inside mala2DataSet1.xsd - Anunc table - the following query
INSERT INTO Anunc (CODINT) VALUES(@codint) and inside the query Builder, the execute Query works well.
the name of the query is InsertQueryCod2ann, Comand type - text, ComandMod - NonQuery, parameter name - @Codint and DBType = int32
I tried to accomplish results the same way with
Me.AnuncTableAdapter.Inser tQueryCod2 ann(Me.Mal a2DataSet1 .Anunc, vcod)
The error message is:
Error 2 Value of type 'CFEMP71.mala2DataSet1.Anu ncDataTabl e' cannot be converted to 'Integer'.
looking for help
Thanks
Dov
I have a select query with the executeMod Reader, FillMethodName Fillby_Cod and GetMethodname GetDataBy_cod
in order to populate a DataGridvalue with the cod or heigher number I called:
Me.AnuncTableAdapter.FillB
I have to add a row to a table named "anunc" and populate only the codint field.
With a select query I created inside mala2DataSet1.xsd - Anunc table - the following query
INSERT INTO Anunc (CODINT) VALUES(@codint) and inside the query Builder, the execute Query works well.
the name of the query is InsertQueryCod2ann, Comand type - text, ComandMod - NonQuery, parameter name - @Codint and DBType = int32
I tried to accomplish results the same way with
Me.AnuncTableAdapter.Inser
The error message is:
Error 2 Value of type 'CFEMP71.mala2DataSet1.Anu
looking for help
Thanks
Dov
Which overloaded update method are you trying to use? The compiler tries its best to match up parameter types, and when it can't find a match, then it complains...
>I have to add a row to a table named "anunc" and populate only the codint field.
>error message is:
>Error...Value of type 'CFEMP71.mala2DataSet1.Anu ncDataTabl e' cannot be converted to 'Integer'.
Where in the VB.NET or the SQL does it validate that the value in codint was actually an integer? For example, if a user typed 'banana' and ran that function, and that was passed, it would return a similar error message.
>error message is:
>Error...Value of type 'CFEMP71.mala2DataSet1.Anu
Where in the VB.NET or the SQL does it validate that the value in codint was actually an integer? For example, if a user typed 'banana' and ran that function, and that was passed, it would return a similar error message.
ASKER
Hi,
As you can see I use the wizard for this operation.
in the mala2DataSet1.xsd, table anunc, I create an insert query.
The parameter is @codigo int 32
I check and execute the query inside the query builder.
I give a number to the value requested and Ok it.
I receive a confirmation.
I verify the result in the preview data window.
Codigo 20226 appears as the last record in the anunc Table.
I think that the error message: AnuncDataTable' cannot be converted to 'Integer'
refers to the fact that data table cannot be converted to an integer and that the query that I wrote - Me.AnuncTableAdapter.Inser tQueryCod2 ann(Me.Mal a2DataSet1 .Anunc, vcod) - is Wrong
Looking forward to hear from you
Dov
insert-2.gif
As you can see I use the wizard for this operation.
in the mala2DataSet1.xsd, table anunc, I create an insert query.
The parameter is @codigo int 32
I check and execute the query inside the query builder.
I give a number to the value requested and Ok it.
I receive a confirmation.
I verify the result in the preview data window.
Codigo 20226 appears as the last record in the anunc Table.
I think that the error message: AnuncDataTable' cannot be converted to 'Integer'
refers to the fact that data table cannot be converted to an integer and that the query that I wrote - Me.AnuncTableAdapter.Inser
Looking forward to hear from you
Dov
insert-2.gif
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi,
Thanks a lot. works perfect.
Dov
Thanks a lot. works perfect.
Dov