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

DataAdapter/DataSet in non-form application??

This may be more of a Visual Studio question than a C# question, but it came
up within the context of a C# app, so here it is.

In a Windows Form or a Web Form application, you can drag various
DataAdapters and create DataSets bound to them so everything is strongly
typed - a very nice feature.

Why in the world can this not be done the same way for ANY type of
application (say, Console, or Class Library). What do these features have
to do with form applications?

I know how to create the datasets myself (create a new dataset and, in this
case, since I'm working with SQLServer, I can just drag the table I want
over from the Server Explorer window). But what about the DataAdapters? Is
there some way that I've missed to set them up in the same manner?

Thanks!

--
Adam Clauss
ca*****@tamu.edu
Nov 16 '05 #1
4 1973
Probably because console apps and classes in class libraries typically do
not require WYSIWYG type design. Where as windows and web forms do. This
also applies to user controls, etc - anything that by definition is going to
have composite controls/components on it.

Now, for console apps and regular classes, obviously the controls are
useless - there is no design surface to speak of. So you are left with
components - an example of which is the sqldataadapter. Now true, it is
possble for MS to have done something to help you out here - but would have
been a lot of extra work for them, for something frankly, not that useful.

Besides, you are better off not using the garbage the designer generates for
SQL related components. It is always better to write your own code and not
rely on the wizard, which not only generates a lof of extra stuff, but is
known to be buggy. Typically, the wizard really ties you down to specific
databases/tables, and is not very helpful in creating reusable code.

"Adam Clauss" <ca*****@nospam.tamu.edu> wrote in message
news:u1****************@TK2MSFTNGP15.phx.gbl...
This may be more of a Visual Studio question than a C# question, but it came up within the context of a C# app, so here it is.

In a Windows Form or a Web Form application, you can drag various
DataAdapters and create DataSets bound to them so everything is strongly
typed - a very nice feature.

Why in the world can this not be done the same way for ANY type of
application (say, Console, or Class Library). What do these features have
to do with form applications?

I know how to create the datasets myself (create a new dataset and, in this case, since I'm working with SQLServer, I can just drag the table I want
over from the Server Explorer window). But what about the DataAdapters? Is there some way that I've missed to set them up in the same manner?

Thanks!

--
Adam Clauss
ca*****@tamu.edu

Nov 16 '05 #2
Marina,

Nice start and than I thought is Marina writing this????? That is the one
who never uses the wizards.

That you showed at the end of the message and than I understood it again.

However in my opinion there was not much to add at the end, you had written
it already that you can use it with all items that have a design surface,
and to give this message some sense as well for the OP even with a user
control. So when you add too a console application a component class, you
have your surface to use it.

:-)

Cor
Nov 16 '05 #3
Well, in this case I started off writing my own code, but I'm at something
of a loss at the moment. I'm using an image column type in an SQL table to
store various amounts of binary data (Yes, I know I could store it on the
file system and simply store the path to the file, but I have other reasons
application specific). Unfortunately, SQL queries seem unable to handle
this data type if the length gets too big (for example, for INSERT's). So,
I thought I would just setup a dataadapter and dataset to handle all this...
but apparently that's not possible.
Probably because console apps and classes in class libraries typically do
not require WYSIWYG type design. Where as windows and web forms do. This
also applies to user controls, etc - anything that by definition is going
to
have composite controls/components on it. So? OOP - the data should be completely separate from the controls anyway.
The fact that they are being tied together here isn't right.
components - an example of which is the sqldataadapter. Now true, it is
possble for MS to have done something to help you out here - but would
have
been a lot of extra work for them, for something frankly, not that useful. A lot of extra work? The work has already been done for form apps! And how
is it not that useful? If it a) works for my needs, and b) saves time, then
it is incredibly useful!

--
Adam Clauss
ca*****@tamu.edu
"Marina" <so*****@nospam.com> wrote in message
news:uY**************@TK2MSFTNGP10.phx.gbl... Probably because console apps and classes in class libraries typically do
not require WYSIWYG type design. Where as windows and web forms do. This
also applies to user controls, etc - anything that by definition is going
to
have composite controls/components on it.

Now, for console apps and regular classes, obviously the controls are
useless - there is no design surface to speak of. So you are left with
components - an example of which is the sqldataadapter. Now true, it is
possble for MS to have done something to help you out here - but would
have
been a lot of extra work for them, for something frankly, not that useful.

Besides, you are better off not using the garbage the designer generates
for
SQL related components. It is always better to write your own code and not
rely on the wizard, which not only generates a lof of extra stuff, but is
known to be buggy. Typically, the wizard really ties you down to specific
databases/tables, and is not very helpful in creating reusable code.

"Adam Clauss" <ca*****@nospam.tamu.edu> wrote in message
news:u1****************@TK2MSFTNGP15.phx.gbl...
This may be more of a Visual Studio question than a C# question, but it

came
up within the context of a C# app, so here it is.

In a Windows Form or a Web Form application, you can drag various
DataAdapters and create DataSets bound to them so everything is strongly
typed - a very nice feature.

Why in the world can this not be done the same way for ANY type of
application (say, Console, or Class Library). What do these features
have
to do with form applications?

I know how to create the datasets myself (create a new dataset and, in

this
case, since I'm working with SQLServer, I can just drag the table I want
over from the Server Explorer window). But what about the DataAdapters?

Is
there some way that I've missed to set them up in the same manner?

Thanks!

--
Adam Clauss
ca*****@tamu.edu


Nov 16 '05 #4
Adam,

You readed my message too Marina where in was a part extra for you as well,
in my opinion it should not be a problem at all.

Cor
Nov 16 '05 #5

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

Similar topics

3
by: Stephen Noronha | last post by:
I have a question, please correct me if I am wrong. I am assuming that a dataadapter establishes a connection and after filling the dataset or datatable or whatever, will close the connection to...
8
by: Zorpiedoman | last post by:
I keep getting a concurrency exception the second time I make a change and attempt to update a dataadapter. It appears this is by design, so there must be something I can do to avoid it. ...
0
by: davefromalbury | last post by:
I have a gridview connected to a objectdatasource. Can't for the life of me get it to display anything though, always appears empty. The dataset always seems to be filled with records, as the...
2
by: susan.f.barrett | last post by:
Hi, Despite me being able to type the following in to SQL Server and it updating 1 row: > updatestockcategory 1093, 839 In my code, it is not updating any rows. dataSet = new DataSet();
6
by: Rich | last post by:
Dim da As New SqlDataAdapter("Select * from tbl1", conn) dim tblx As New DataTable da.Fill(tblx) '--works OK up to this point da.UpdateCommand = New SqlCommand da.UpdateCommand.Connection =...
2
by: MDB | last post by:
Hello All, I have a data grid that I fill using a dataset. The results of the query has around 15 columns and 500 rows (and growing). The reason I am using the datagrid is so the end users can...
5
by: Emil | last post by:
I've created a very simple data base in Microsoft Access 2003. It consists of only one table called "Students" and it contains 2 information about each student: id-student and name. When I try...
0
by: mike1402 | last post by:
Hi ! I get the error below sometimes when retrieving a big amount of data using Datadapter.Fill(dataset,"table"). But when I send the command Fill again, there is no error. Is it a fault of...
3
by: Fred Chateau | last post by:
Any obvious reason here why data is not being loaded into the database? SqlDataAdapter dataAdapter = new SqlDataAdapter(sqlCommand); SqlCommandBuilder commandBuilder = new...
2
by: BobLewiston | last post by:
I can read in an SQL table ("Person.Contact") from AdventureWorks and step through it one row at a time, but when I try to save a record, either one I'm inserting or one I'm editting, I get the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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...

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.