Hi!
A question about database tables...
I have a SELECT statement:
SELECT something FROM someTable WHERE code = @code
The parameter code starts with 1 and is autoincremented ...
Now I want to add a row to the database and I do it like this:
DataSet dataSet = new DataSet();
dataAdapter.Sel ectStatement.Pa rameters[0].Value = 0; // *
dataAdapter.Fil l(dataSet); //
*
dataSet.Tables[0].AddRow(....);
The question is about the two rows marked with a *... I do this only to get
the schema of the table...
Is there anyother way to get the schema of the table? And can you the update
just the DataTable, without
it being in a DataSet?
thanks,
saso 3 5298
"Saso Zagoranski" <sa************ *@guest.arnes.s i> wrote in
news:bp******** **@planja.arnes .si: Hi!
A question about database tables... I have a SELECT statement: SELECT something FROM someTable WHERE code = @code
The parameter code starts with 1 and is autoincremented ...
Now I want to add a row to the database and I do it like this: DataSet dataSet = new DataSet(); dataAdapter.Sel ectStatement.Pa rameters[0].Value = 0; // * dataAdapter.Fil l(dataSet); // * dataSet.Tables[0].AddRow(....);
The question is about the two rows marked with a *... I do this only to get the schema of the table... Is there anyother way to get the schema of the table? And can you the update just the DataTable, without it being in a DataSet?
thanks, saso
HI Saso,
Why don't you perform the update directly with an SqlCommand object if
you don't want to use the DataSet?
A dataTable can be used only in conjunction with a DataSet. So your only
chance is either to use the DataSet features or to stick with standalone-
commands.
greets
Peter
--
------ooo---OOO---ooo------
Peter Koen - www.kema.at
MCAD CAI/RS CASE/RS IAT
------ooo---OOO---ooo------
Thanks Peter!
Good point... I'll try and use the SqlCommand instead :)
saso
"Peter Koen" <koen-newsreply&snusn u.at> wrote in message
news:eK******** ******@TK2MSFTN GP11.phx.gbl... "Saso Zagoranski" <sa************ *@guest.arnes.s i> wrote in news:bp******** **@planja.arnes .si:
Hi!
A question about database tables... I have a SELECT statement: SELECT something FROM someTable WHERE code = @code
The parameter code starts with 1 and is autoincremented ...
Now I want to add a row to the database and I do it like this: DataSet dataSet = new DataSet(); dataAdapter.Sel ectStatement.Pa rameters[0].Value = 0; // * dataAdapter.Fil l(dataSet); // * dataSet.Tables[0].AddRow(....);
The question is about the two rows marked with a *... I do this only to get the schema of the table... Is there anyother way to get the schema of the table? And can you the update just the DataTable, without it being in a DataSet?
thanks, saso
HI Saso,
Why don't you perform the update directly with an SqlCommand object if you don't want to use the DataSet?
A dataTable can be used only in conjunction with a DataSet. So your only chance is either to use the DataSet features or to stick with standalone- commands.
greets Peter
-- ------ooo---OOO---ooo------
Peter Koen - www.kema.at MCAD CAI/RS CASE/RS IAT
------ooo---OOO---ooo------
maybe this will help.
//------------------------------------------------------------------
DB_Connection.O pen();
// Get the Table Names from DataBase
DB_SchemaTable =
DB_Connection.G etOleDbSchemaTa ble(System.Data .OleDb.OleDbSch emaGuid.Tables,
new object[] {null, null, null, "TABLE"});
// Reserve the Strings for the Table Names
sa_TableNames = new String[DB_SchemaTable. Rows.Count];
for (int i=0;i<DB_Schema Table.Rows.Coun t;i++)
{
DataRow dr_Row = DB_SchemaTable. Rows[i];
// Store the Table Name
sa_TableNames[i] = dr_Row["TABLE_NAME "].ToString();
}
Mark Johnson, Berlin Germany mj*****@mj10777 .de
"Saso Zagoranski" <sa************ *@guest.arnes.s i> schrieb im Newsbeitrag
news:bp******** **@planja.arnes .si... Hi!
A question about database tables... I have a SELECT statement: SELECT something FROM someTable WHERE code = @code
The parameter code starts with 1 and is autoincremented ...
Now I want to add a row to the database and I do it like this: DataSet dataSet = new DataSet(); dataAdapter.Sel ectStatement.Pa rameters[0].Value = 0; // * dataAdapter.Fil l(dataSet);
// * dataSet.Tables[0].AddRow(....);
The question is about the two rows marked with a *... I do this only to
get the schema of the table... Is there anyother way to get the schema of the table? And can you the
update just the DataTable, without it being in a DataSet?
thanks, saso
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Steve Jorgensen |
last post by:
I've run across this issue several times of late, and I've never come up with
a satisfactory answer to the best way to handle this schema issue. You have a
large section of schema in which a subset of records across all tables is
often considered a separate logical system, but sometimes may be treaded ar
part of the global system, and there is not simply a 1-m-m... tree among the
records in a logical database.
Here's an example. A...
|
by: MP |
last post by:
Greets,
context: vb6/ado/.mdb/jet 4.0 (no access)/sql
beginning learner, first database, planning stages
(I think the underlying question here is whether to normalize or not to
normalize this one data field - but i'm not sure)
:-)
Background info:
|
by: shsandeep |
last post by:
The ETL application loaded around 3000 rows in 14 seconds in a Development
database while it took 2 hours to load in a UAT database.
UAT db is partitioned.
Dev db is not partitioned.
the application looks for existing rows in the table...if they already
exist then it updates otherwise inserts them.
The table is pretty large, around 6.5 million rows.
|
by: Brian Tkatch |
last post by:
This is a shell question (bash), but i'm more familiar with this group,
so i hope noone minds.
I have a bash shell script which needs to query the database and return
information into a variable. This can be done with a subshell, but that
slows everything down because it is within a loop (and would be done
mutiple times) and it would need a new login each time. As such, i got
it to work via a temp file something like:
db2 -xt +p <<...
|
by: mkarbarz |
last post by:
Hello,
I need to come up with a stored procedure that will allow me to read
data from another database. The database I need to read the data from
is a UniData residing on a Unix server. The stored procedure needs to
reside on my sql 2005 server. The task is very simple in Access as we
have ODBC connections set up to the UniData via Informix (or IBM)
UniData ODBC drivers. I can easily combine my UniData and Sql Server
tables from...
| |
by: h4xPace |
last post by:
I am building a MySQL query application, and I have run into a small
snag. MySQL has released a set of classes that extend the .NET
framework base data classes (command, connection, etc), and I am using
them to interact with the MySQL server (on localhost). Everything
works great on that side of the aisle.
However, I have never worked with getting schema from a database
before, so I am fumbling around for a workable solution to doing...
|
by: situ |
last post by:
Hello all,
i have Database1 and database2,
is it possible to make database connection to database2 by running
stored procedure on database1.
Thanks and Regards
Situ
|
by: nyathancha |
last post by:
Hi,
I have a question regarding best practices in database design. In a
relational database, is it wise/necessary to sometimes create tables
that are not related to other tables through a foreign Key
relationship or does this always indicate some sort of underlying
design flaw. Something that requires a re evaluation of the problem
domain?
The reason I ask is because in our application, the user can perform x
|
by: karanbikash |
last post by:
Hi ,
I would like to know :
1.how to find all the schema in my DB2 database on Main frame
machine .
2. How to see all the tables for a given schema .
3. What are the default schema in Db2 on Mainframe . zOS.
I know all the above when I connect to DB2 on LUW ..
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |