Data adapter blues
Data adapter blues
Data adapter blues
Data adapter blues
Data adapter blues
Data adapter blues Data adapter blues Data adapter blues Data adapter blues Data adapter blues Data adapter blues Data adapter blues Data adapter blues
Data adapter blues Data adapter blues
Data adapter blues
Go Back  Xtreme Visual Basic Talk > > > Data adapter blues


Reply
 
Thread Tools Display Modes
  #1  
Old 07-30-2017, 03:46 PM
VB_Alien VB_Alien is offline
Senior Contributor
 
Join Date: Apr 2004
Posts: 854
Default Data adapter blues


I am trying to make my database program load different
databases but i get stalled at the data adapter but i think
the trouble is really with my sql command line.

My sql command line at first was hard coded
because i knew what my table name was in my
database and i was only working with the one
database and one table.

I decided to fix my program so that i can open
any access database but without knowing what the
table name would be, it throws an error, something
about my (FROM) clause being wrong and its right.

My sql command looks like this
SELECT * FROM [Movies]

This was used for the first database to get to working.
The problem is that my data adapter is looking at my
sql command line and saying, Hold on there. Movies
isnt a table in this new database that you are trying to
open..

I was wondering if there is a sql command that will
tell the adapter to open the first table in the database
without the programmer having to hard code the table
name everytime a new database is loaded.
Reply With Quote
  #2  
Old 07-30-2017, 07:49 PM
Kluz's Avatar
KluzData adapter blues Kluz is offline
Sapience.Aquire

Super Moderator
* Expert *
 
Join Date: Oct 2003
Location: Lake Bluff, Ill., U.S.
Posts: 3,443
Default

I've never used it but there is an AllTables collection that might allow you to access the table onject via an index number rather than name. You'll have to grab the name property and concatenate it into your SQL statement.
__________________
No the other right mouse click
Reply With Quote
  #3  
Old 07-30-2017, 10:39 PM
VB_Alien VB_Alien is offline
Senior Contributor
 
Join Date: Apr 2004
Posts: 854
Default

Ya. I kind of took a different route. Instead of opening the database
and dumpping the data into an adapter first, i just open the database
ānd then i get a list of all tables in it first. Then i can get the first table
name from that list and put the nama in my sql command line. After
that, the data is dumpped into an adapter with no more complaints.
Sorry to have bothered you..
Reply With Quote
Reply

Tags
database, table, command, sql, adapter, line, data, program, hard, hold, [movies], select, programmer, code, loaded, everytime, blues, wondering, movies, error, load, decided, fix, databases, stalled


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Data adapter blues
Data adapter blues
Data adapter blues Data adapter blues
Data adapter blues
Data adapter blues
Data adapter blues Data adapter blues Data adapter blues Data adapter blues Data adapter blues Data adapter blues Data adapter blues
Data adapter blues
Data adapter blues
 
Data adapter blues
Data adapter blues
 
-->