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

Returning database schemas

Hi, I am storing information being sent to me weekly into a ms sql
database. The one twist I am running into is that later down the line
the information I recieve may require more columns, or columns might
be renamed so having a static database call is out of the question. I
was using mysql but for certain reasons switched to ms sql 2000.
Currently before ms sql, I query the database for show fields which
returns all the database data such as type, column name, etc... then I
use a giant if statement structure to deal with matching and
converting data from my users display to the information into the
database.

So my first question is how do I either query or using datatypes built
into C# return information about a tables setup. I was hoping there
was some sort of table array object which could be returned with names
and types, if not then just an sql statement return.

My second question is I have user data which needs to be displayed
differently then the database raw data, how do I use a C# dataset, and
convert it's column data into my raw database data without having to
create raw insert and update sql strings myself? I would really like
to use the sort of automatic update features of the dataset.

Lastly am I going about this the wrong way? Are there other ways to
map & convert datatypes between a dataset column and a table column.
Jul 20 '05 #1
1 2168
sa*****@hotmail.com (Craig) wrote in message news:<35**************************@posting.google. com>...
Hi, I am storing information being sent to me weekly into a ms sql
database. The one twist I am running into is that later down the line
the information I recieve may require more columns, or columns might
be renamed so having a static database call is out of the question. I
was using mysql but for certain reasons switched to ms sql 2000.
Currently before ms sql, I query the database for show fields which
returns all the database data such as type, column name, etc... then I
use a giant if statement structure to deal with matching and
converting data from my users display to the information into the
database.

So my first question is how do I either query or using datatypes built
into C# return information about a tables setup. I was hoping there
was some sort of table array object which could be returned with names
and types, if not then just an sql statement return.

My second question is I have user data which needs to be displayed
differently then the database raw data, how do I use a C# dataset, and
convert it's column data into my raw database data without having to
create raw insert and update sql strings myself? I would really like
to use the sort of automatic update features of the dataset.

Lastly am I going about this the wrong way? Are there other ways to
map & convert datatypes between a dataset column and a table column.


Have you looked at the INFORMATION_SCHEMA views?
INFORMATION_SCHEMA.COLUMNS has details about every column, including
data type etc. Or there is sp_help, but it returns multiple result
sets, so it may not be so easy to work with.

Regarding your dataset questions, you might get a better response in a
..Net development group.

Simon
Jul 20 '05 #2

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

Similar topics

6
by: Dim St Thomas | last post by:
I am a developer working on a database client program. I am testing this program on a Windows XP machine (1.5 GHz AMD chip, 480 Mb RAM, 60 Gb disk) This machine has Oracle 9.2.0.1.0 and RedBrick...
3
by: RobertG | last post by:
Hello I have 2 databases on PostgreSQL, for instance base1, base2. I connect to psql: psql -p 3333 base1 how can I access to base2 ? for instance I wont do instruction: insert into test(a, b)...
0
by: Anand Natrajan | last post by:
Hi! I have a VB .NET client that is accessing an rpc/encoded service deployed in Axis 1.2. One of the operations, whoami, returns a string array. The server-side Java signature of this method is...
0
by: Pentti | last post by:
Can anyone help to understand why re-parsing occurs on a remote database (using database links), even though we are using a prepared statement on the local database: Scenario: ======== We...
1
by: Thomas LeBlanc | last post by:
I have 2 databases. I want to move data from table table1 in database db1 to table2 in db2. When I query 1 table from another database, I get a cross-database references are not implemented. ...
1
by: JonJon | last post by:
I'm currently using .NET Framework 2.0 with WSE 3.0. I've read many articles that DataTables are now serializable and can be passed via web services. However when I have a datatable as my return...
8
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
0
by: JB | last post by:
Hi All, I'd like to know how to get a list of available Schemas in a Database via ODBC. I had a look at the GetSchema function but I can only get a list of Tables. Ideally I'd like to get just...
0
by: Algobardo | last post by:
Good morning, this is the first time i write on this forum because i googled and i've seen related post with no solution. I will expose briefly the problem. I'm using c# 3.5 and i'm trying using...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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
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.