Wrox Programmer Forums
|
Visual Basic 2005 Basics If you are new to Visual Basic programming with version 2005, this is the place to start your questions. For questions about the book: Beginning Visual Basic 2005 by Thearon Willis and Bryan Newsome, ISBN: 0-7645-7401-9 please, use this forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2005 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 4th, 2008, 11:21 AM
Registered User
 
Join Date: Sep 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default SQL table Adapter

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?

 
Old September 7th, 2008, 10:16 AM
Authorized User
 
Join Date: Jun 2008
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It seems like the parameter idEnc is not set correctly. Maybe you could post the code to set this parameter to the forum too.

 
Old September 8th, 2008, 03:11 AM
Registered User
 
Join Date: Sep 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

My point is that, i dont know how to define the parameter, would appreciate any help.

 
Old September 8th, 2008, 05:53 AM
Authorized User
 
Join Date: Jun 2008
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

a google search helps:

http://www.codeproject.com/KB/databa...ta_Access.aspx

 
Old September 8th, 2008, 06:56 AM
Registered User
 
Join Date: Sep 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by Koeno
 a google search helps:

http://www.codeproject.com/KB/databa...ta_Access.aspx

Thanks

when i use this line (according to that guide)



Code:
    Dim sqlparams(4) As SqlClient.SqlParameter

The error under the word sqlparams is "Declaration expected"
sqlparams(4) = SqlParameter() {  new SqlParameter("@inputone"...),   new SqlParameter("@inputtwo"...),   new SqlParameter("@inputthree"...) }
 
Old September 18th, 2008, 04:21 AM
Registered User
 
Join Date: Sep 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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







Similar Threads
Thread Thread Starter Forum Replies Last Post
using two-way sql adapter to insert into 2 tables? shazza Biztalk 0 May 14th, 2007 01:18 PM
Table Adapter Query - Am i missing something? In Distress Visual Studio 2005 6 January 11th, 2007 05:55 PM
Sql statements in data adapter Raif ASP.NET 1.0 and 1.1 Basics 1 July 14th, 2004 08:50 AM
Adapter for SQL erisa Biztalk 3 February 25th, 2004 09:28 AM
SQL Data Adapter jbenson001 ASP.NET 1.x and 2.0 Application Design 6 December 18th, 2003 12:13 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.