473,397 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

VB.NET - TableAdapter Parameter error

6
his SQL statement is used on the table adapter for the datagridview1

SELECT Descrição, idEncomendado, Estado, NºSerie, Actualização, NumEnc
FROM Table_1Encomendados
WHERE NumEnc = @idEnc

but then i get this error

Error 1 Argument not specified for parameter 'idEnc' of 'Friend Overridable Overloads Function Fill(dataTable As demoDataSet2.Table_1EncomendadosDataTable, idEnc As String) As Integer'. C:\Documents and Settings\bruno.amorim\Os meus documentos\Visual Studio 2005\Projects\WindowsApplication1\WindowsApplicati on1\frmMain.vb 67 9 WindowsApplication1

on the line

Me.Table_1EncomendadosTableAdapter.Fill(Me.DemoDat aSet2.Table_1Encomendados)


idEnc is declared in a module as Friend integer

How is it possible to see the "Preview query" on the datagridview working but, whem you go to the code this error appears?
Sep 5 '08 #1
8 3965
Curtis Rutland
3,256 Expert 2GB
Well, where have you defined your parameter at?

The preview query probably pops up a window for you to give the parameter a value, but that won't work in the application.
Sep 5 '08 #2
kalas
6
the var IdEnc is defined in a Module as Friend Integer
Sep 5 '08 #3
Curtis Rutland
3,256 Expert 2GB
the var IdEnc is defined in a Module as Friend Integer

Right, but where have you actually defined the parameter? You can't just define a variable that has the same name and expect it to be the parameter.
Sep 5 '08 #4
kalas
6
Right, but where have you actually defined the parameter? You can't just define a variable that has the same name and expect it to be the parameter.

Then i guess , i didnt defined the parameter, can you help me out?
Sep 5 '08 #5
Curtis Rutland
3,256 Expert 2GB
Then i guess , i didnt defined the parameter, can you help me out?
Post the relevant parts of your code, I'll see what I can do.
Sep 5 '08 #6
kalas
6
this part is where the var idEnc gets a value

Expand|Select|Wrap|Line Numbers
  1.         Try
  2.             idEnc = Dgv_Table1t.CurrentRow.Cells("IdEncomendaDataGridViewTextBoxColumn").Value
  3.             Cliente = Dgv_Table1t.CurrentRow.Cells(2).Value
  4.             Label1.Text = idEnc
  5.             Label2.Text = Dgv_Table1t.CurrentRow.Index
  6.  
  7.         Catch ex As Exception
  8.             Dgv_Table1t.Select()
  9.         End Try
this is used to Fill data into the datagridview
Sep 8 '08 #7
kalas
6
a parameter cant be declared this way?

Friend update() As Integer = {"@idEnc"}
Sep 10 '08 #8
kalas
6
Thank you but,

it doesn't work as i wanted, but i think my point is pretty simple and i dint explained myself right

I load dataset1 into a datagridview on form1, when the program starts in form 1 , user selects one row of the table and from that selection i extract one integer value from a certain column . (example: user selected line 1 and idEnc gets value 4)

that value is then (in a Friend integer var) used to fill datagridview2 in form2 with other table WHERE some column in that table equals idEnc.

I use the value form idEnc to be displayed in some labels in form2.

Dont know if this can be done exactly in the way i explained
Post is abusive
Sep 18 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: dbuchanan | last post by:
Hello, I have added a query to my TableAdapter that accepts a parameter (The ID) to filter the data. It will return only one record. I tested it in the designer and it returns one record as...
9
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got...
3
by: Mike | last post by:
Dear Group, When I add a DataTable to a Typed Dataset, and a TableAdapter to the DataTable, I am able to create methods to send updates directly to the database (GenerateDBDirectMethods),...
0
by: vbnetguy | last post by:
Hopefully someone has an answer for this or maybe I am missing something. I have a stored procedure - this stored procedure is used as my main insert for a tableadapter I am doing something...
3
by: Crazy Cat | last post by:
I've created a TableAdapter which implements the following SQL statement SELECT MSC.MSC_NAME AS NAME, Capacity.Capacity AS CAPACITY FROM Capacity INNER JOIN MSC ON Capacity.MSC_KEY =...
0
by: rpuertas | last post by:
Hello, Visual Web Developer 2005 Express Edition and SQL Server 2005 Express: I want to run a paged query within a TableAdapter. In the TableAdapter Query Configuration Wizard" I write the next...
3
by: =?Utf-8?B?UmljaCBIdXRjaGlucw==?= | last post by:
I'm not really sure how to ask this question because I'm still getting my feet wet with data access and VB.NET, but here goes: To start off with, I'm using VB 2005 Express to connect to an Access...
0
by: jonnyc23 | last post by:
Hi I'm using table adapters and have managed to get them working with query parameters but I can't seem to find a way to do something like the following: select NodeId, Time, Data from...
1
by: Craig Buchanan | last post by:
I created a TableAdapter (TA) in my VB 2005 project. I tested it to ensure that its CRUD functionality is what I expected it to be. I'm using the TA and its strongly-typed DataTable (DT) in my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.