473,473 Members | 1,953 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

VisualStudio.net asp.net and DB question

can anyone out there give me a little advice concerning the common way to add
database queries to a form? I'm doing it manually now, but it appears that it
can be done /w drag and drop. So far the result is just way too confusing. Is
there an artical or book that can help me get the most out of
VisualStudio.net?
Thank you!!!
kes
Nov 19 '05 #1
6 1252
> can anyone out there give me a little advice concerning the common way to
add
database queries to a form? I'm doing it manually now, but it appears that
it
can be done /w drag and drop. So far the result is just way too confusing.


Well, I think you _do_ need to understand the concepts of data connectivity,
but once you get familiar with it, all the wizard- and dragdrop-stuff makes
pretty good sense.

Look into these classes, and how they interact:

Connection (sqlConnection for sql-server, otherwise mostly oledbConnection)
DataAdapter (sqlDataAdapter/oledbDataAdapter)
Dataset

Once you get familiar with them, you can drag and drop tables/fields from
the Server Explorer, and the connection and dataAdapter will be created for
you.

But.... first do some reading up on the subject. It might take a few days,
maybe even a couple of weeks, to get real comfortable with ado.net, but
there is method to the ado.net madness. You will see the light :-)

This is a good place to start:
http://msdn.microsoft.com/data/DataA...t/default.aspx

Jeppe Jespersen
Nov 19 '05 #2
Thanks for your help

I have looked at the classes and i'm doing the coding by hand. the
connectivity is fairly basic, but VisualStudio.Net creates subroutines that i
don't understand very well. I guess what i'm asking for is a step by step
example of drag and drop and how the created sub's interact. say for the
following:
new form with a datalist.
1. which should get created first the datalist or the OleDbConnection or (?)
2. when a connection is dragged onto a page. what is created and what needs
to be modified?
thanks
kes
"Jeppe Dige Jespersen" wrote:
can anyone out there give me a little advice concerning the common way to
add
database queries to a form? I'm doing it manually now, but it appears that
it
can be done /w drag and drop. So far the result is just way too confusing.


Well, I think you _do_ need to understand the concepts of data connectivity,
but once you get familiar with it, all the wizard- and dragdrop-stuff makes
pretty good sense.

Look into these classes, and how they interact:

Connection (sqlConnection for sql-server, otherwise mostly oledbConnection)
DataAdapter (sqlDataAdapter/oledbDataAdapter)
Dataset

Once you get familiar with them, you can drag and drop tables/fields from
the Server Explorer, and the connection and dataAdapter will be created for
you.

But.... first do some reading up on the subject. It might take a few days,
maybe even a couple of weeks, to get real comfortable with ado.net, but
there is method to the ado.net madness. You will see the light :-)

This is a good place to start:
http://msdn.microsoft.com/data/DataA...t/default.aspx

Jeppe Jespersen

Nov 19 '05 #3
1. which should get created first the datalist or the OleDbConnection or (?) 2. when a connection is dragged onto a page. what is created and what needs to be modified?


1. If you add both the datalist and the connection at design time, it
doesn't matter much which one you add first. However, some properties on the
datalist can't be set until you have data components added.

2. First off, I would use Server Explorer (CTRL-ALT-S) to drill down into my
database, and then drag the _tables_ directly to my form. This automatically
creates a connection and a dataAdapter (one for each dragged table), and
then all you need is to add a dataset. To do this, right-click the adapter,
and pick "Generate Dataset".

3. Once you have the dataset, you can set databinding properties on, say, a
datalist. Then, when the form runs (form_load event) you can call the "fill"
method on the adapter, then the "databind" method on your datalist, and you
should see data in the list.

....maybe... :-)

Jeppe Jespersen
Nov 19 '05 #4
Thanks this is a help and it was what i was looking for!
It may have seemed simple to you, but it was jsut the sort of thing i need
to prime the pump.
thanks
kes

"Jeppe Dige Jespersen" wrote:
1. which should get created first the datalist or the OleDbConnection or

(?)
2. when a connection is dragged onto a page. what is created and what

needs
to be modified?


1. If you add both the datalist and the connection at design time, it
doesn't matter much which one you add first. However, some properties on the
datalist can't be set until you have data components added.

2. First off, I would use Server Explorer (CTRL-ALT-S) to drill down into my
database, and then drag the _tables_ directly to my form. This automatically
creates a connection and a dataAdapter (one for each dragged table), and
then all you need is to add a dataset. To do this, right-click the adapter,
and pick "Generate Dataset".

3. Once you have the dataset, you can set databinding properties on, say, a
datalist. Then, when the form runs (form_load event) you can call the "fill"
method on the adapter, then the "databind" method on your datalist, and you
should see data in the list.

....maybe... :-)

Jeppe Jespersen

Nov 19 '05 #5
It may have seemed simple to you, but it was jsut the sort of thing i need
to prime the pump.


If it's any comfort, this did not seem simple to me just a few months ago.

Keep at it. :-)
Jeppe
Nov 19 '05 #6
Thanks you it is a comfort! I've been a programmer since the early 80's on
every thing from rpg,II,III,400 to IBM(360/370) Macro ASM - SQL before it
was called that. And i've done it all not because i'm a great thinker, but
just because i'm plain stubborn.
Yes It is a GREAT Comfort!!!!
kes IOU1

"Jeppe Dige Jespersen" wrote:
It may have seemed simple to you, but it was jsut the sort of thing i need
to prime the pump.


If it's any comfort, this did not seem simple to me just a few months ago.

Keep at it. :-)
Jeppe

Nov 19 '05 #7

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

Similar topics

1
by: Jerry | last post by:
Hi, I want to create a compound field i.e. CityStateZip and then build a formula that is composed of the 3 data elements .City, .State and .ZIP. I've done this before creating a formula in...
1
by: TIBM | last post by:
Hi. I have a VisualStudio.NET solution composed of multiple projects. Each project gets compiled into its own dll. How can I compile 2 or more projects into a single dll I don't want to do a manual...
7
by: Peter Smirnov | last post by:
Sorry for this newbie question but as far as I heard one need at least VisualStudio to develop CSharp applications. Is this correct? Are there otherwise some command line tools like javac.exe and...
1
by: Reshma Prabhu | last post by:
Hello, I am encountering a problem after installing VS2005 Beta 2. Whenever I try to open a Pocket PC application in Design mode, I am getting following exception:- Unable to cast COM object...
1
by: Maziar Aflatoun | last post by:
Hi everyone, I'm relatively new to VisualStudio 2003 and have to create an application that uses Web Services to authenticate a user. Once that user is authenticated I use the Web services...
5
by: John H Clark | last post by:
I am building an IHttpHandlerFactory to process all requests to folders in my site. When an attempt to access internal folders is detected the request is rerouted to an error page. All other...
1
by: Gürkan Demirci | last post by:
Hi, i am using the VisualStudio FormDesigner to create an asp:table. I want to populate an asp:tablecell with different controls at runtime. In the codebehind file, there is an attribute for the...
0
by: maflatoun | last post by:
Hi, I have created a pages using only DIV tags instead of layers. It looks fine when editing it in DreamWeaver but in VisualStudio it's messed up. So in the design view you can't really tell...
1
by: maflatoun | last post by:
Hi, I have created a pages using only DIV tags instead of layers. It looks fine when editing it in DreamWeaver but in VisualStudio it's messed up. So in the design view you can't really tell...
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
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,...
1
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
tracyyun
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...
1
isladogs
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.