473,386 Members | 1,753 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,386 software developers and data experts.

Complications trying to use Table Adapter

I'm using VS2005, VB, WinForms

I’ve developed forms using those nice wizards Microsoft provides. However,
I’m running into a couple of complications trying to work with the resulting
Table Adapters.

1) My user interface allows the user to fill in any combination of perhaps a
dozen Query-By-Example (QBE) fields, and then press a Query button to
generate a list, based on an SQL statement that incorporates those QBE
fields. The list is presented in a DataGridView.
I have ancestor code to generate a full SQL statement based on any
combination of QBE fields entered, including handling typical search symbols
(>, <=, *, etc.). How do I get the generated SQL into a Table Adapter Query?
It looks like Table Adapter Queries are designed to be set up only at design
time (?). I’ve tried to put the whole Where clause into a Parameter, but
this fails. Since the user can enter any combination of the 12 QBE fields it
is impractical to set up Queries to handle all possibilities at design time.

2) I’d like to pass the Table Adapter to parent objects (ancestors in the
same class) for generic save processing. Apparently, Table Adapters can’t be
defined any more precisely than as an Object (?), so I don’t see how to
assign them to an object variable that I can work with in the Ancestor.

So, do I forgo the lovely wizard and build my forms more from scratch, or
can I make Table Adapters flexible enough to handle my requirements?

May 27 '06 #1
1 1722
Bruce,

As I understand your problem than it is all about the SQL Select string.

You can change that in any place in your program, by instance just before
the moment that you try to get the table.

However if it is not working as SQL statement, it will not work in the
tableadapter. I have some thoughts that this is in your situation what is
the reason it won't work.

Cor

"Bruce HS" <Br*****@discussions.microsoft.com> schreef in bericht
news:34**********************************@microsof t.com...
I'm using VS2005, VB, WinForms

I've developed forms using those nice wizards Microsoft provides.
However,
I'm running into a couple of complications trying to work with the
resulting
Table Adapters.

1) My user interface allows the user to fill in any combination of perhaps
a
dozen Query-By-Example (QBE) fields, and then press a Query button to
generate a list, based on an SQL statement that incorporates those QBE
fields. The list is presented in a DataGridView.
I have ancestor code to generate a full SQL statement based on any
combination of QBE fields entered, including handling typical search
symbols
(>, <=, *, etc.). How do I get the generated SQL into a Table Adapter
Query?
It looks like Table Adapter Queries are designed to be set up only at
design
time (?). I've tried to put the whole Where clause into a Parameter, but
this fails. Since the user can enter any combination of the 12 QBE fields
it
is impractical to set up Queries to handle all possibilities at design
time.

2) I'd like to pass the Table Adapter to parent objects (ancestors in the
same class) for generic save processing. Apparently, Table Adapters can't
be
defined any more precisely than as an Object (?), so I don't see how to
assign them to an object variable that I can work with in the Ancestor.

So, do I forgo the lovely wizard and build my forms more from scratch, or
can I make Table Adapters flexible enough to handle my requirements?

May 27 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: JH | last post by:
I have a comma delimited file and I want to export it to an MS access table already designed with appropriate field names. How do I do this programmatically using VB.NET or C#? Thanks for any...
12
by: VMI | last post by:
For some reason, the process of retrieving data (about 20 records) from an Access table that has 400K records to a dataTable is taking over 3 mins. to complete. Below is my code to connect to the...
1
by: Henry | last post by:
I hope someone can help me on this. I have two controls on a form. the first is a comboBox the second is a datagrid. Both controls are bound to tables in a common dataset. What I am trying to...
1
by: Henry | last post by:
Hi. I've been trying to modify my dataset and have been unsucessful. Any help would be great. What I have is a dataset in a session variable. Here is what I have done to stored into the dataset...
11
by: Eych | last post by:
I get a VB error when I try to update a table whose field I change with the following statement: dcUpdate.Dataset.Tables(0).Rows(0)("User Name") = Me.textbox1.Text if I change the field name...
1
by: John | last post by:
Hi When using Table Adapter Configuration Wizard if 'Use SQL Statements' is selected as Command Type, the data table's name in dataset is retained and only its data adapter's select statements...
12
by: Randy | last post by:
Hi, Trying to pass along a table row delete to the datasource, but I'm crashing. Here is the code: Private Sub btnDeleteIngr_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles...
2
by: kjewell23 | last post by:
I'm getting this error column qualifier or table undefined in asp.net Dim connectionstring As String connectionstring = "DRIVER=Client Access ODBC Driver...
2
by: Andrew Cooper | last post by:
Greetings, I'm creating a website using ASP.NET. In creating my DAL I've got a Table Adapter that I've set up to use an existing Stored Procedure from an SQL Server 2000 database. However,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...

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.