473,396 Members | 1,966 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.

Database explorer

Hi all.

What is the use of this window?
Is it only to see the objects/tables of the database?

Lets say I have this code:
Dim SQL As String
SQL = "SELECT * from mytable"

Dim Adapter As New Data.OleDb.OleDbDataAdapter(SQL, connection )

Dim DS As New Data.DataSet

Call Adapter.Fill(DS)

Can I use connection from the database explorer window instead of providing
a connection string ?

I am using this code on several .aspx pages - should I use dim
connectionstring as string in each of them?

Where do I put a global parameter/constant ?

Newbie me....

TIA

Guy


Oct 11 '06 #1
6 1307
"Guy Cohen" <no*****@please.comwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
I am using this code on several .aspx pages - should I use dim
connectionstring as string in each of them?

Where do I put a global parameter/constant ?

Newbie me....
Do yourself a *HUGE* favour and steer well clear of all the new "make it
easy for people who don't know how to write code" database access controls
in ASP.NET 2, and use a DAL (database abstraction layer) instead.

This will get you started, but ultimately you will want to write your own:
http://aspnet.4guysfromrolla.com/articles/070203-1.aspx
Oct 11 '06 #2
Thanks again Mark.

My problem is that my boss wants the fastest solution from me and I am not
familiar with do(n)t net *blush*

Guy

"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:eI*************@TK2MSFTNGP05.phx.gbl...
"Guy Cohen" <no*****@please.comwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
>I am using this code on several .aspx pages - should I use dim
connectionstring as string in each of them?

Where do I put a global parameter/constant ?

Newbie me....

Do yourself a *HUGE* favour and steer well clear of all the new "make it
easy for people who don't know how to write code" database access controls
in ASP.NET 2, and use a DAL (database abstraction layer) instead.

This will get you started, but ultimately you will want to write your own:
http://aspnet.4guysfromrolla.com/articles/070203-1.aspx

Oct 11 '06 #3
"Guy Cohen" <no*****@please.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
My problem is that my boss wants the fastest solution from me and I am not
familiar with do(n)t net *blush*
Believe me, once you have all the base classes in place, this is by far the
best method of rapid robust development.

E.g. here's a basic GridView control:

<asp:GridView ID="MyGridView" runat="server">
...bound fields etc
</asp:GridView>

Let's say I have a stored procedure called "MyStoredProcedure" which returns
the data I need to populate the GridView. With my DAL, this is how it gets
populated:

MyGridView.DataSource = DAL.GetDataSet("MyStoredProcedure");
MyGridView.DataBind();

That't it! Because the DAL is a public class and the GetDataSet method (like
all the others) are static, nothing further is required. Any page in the web
app which needs database connectivity just calls one of the methods in the
DAL. GetDataSet, as its name suggests, returns a DataSet object. Other
methods in the DAL return an SqlDataReader, others perform database writes,
others wrap stuff in transactions, others work with binary data etc.

Of course, the methods in the DAL are overloaded to accept a different
connection string from the default one (which is stored encrypted in
web.config), and also a List<SqlParametergeneric collection to support
parameterised stored procedures.

A relatively small investment in time and effort to set your base classes up
will allow you to whizz through the rest of the development cycle.

Where are you based, AAMOI...?
Oct 11 '06 #4
Mark you are great!

Guy @ Israel
"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:uu**************@TK2MSFTNGP02.phx.gbl...
"Guy Cohen" <no*****@please.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
>My problem is that my boss wants the fastest solution from me and I am
not familiar with do(n)t net *blush*

Believe me, once you have all the base classes in place, this is by far
the best method of rapid robust development.

E.g. here's a basic GridView control:

<asp:GridView ID="MyGridView" runat="server">
...bound fields etc
</asp:GridView>

Let's say I have a stored procedure called "MyStoredProcedure" which
returns the data I need to populate the GridView. With my DAL, this is how
it gets populated:

MyGridView.DataSource = DAL.GetDataSet("MyStoredProcedure");
MyGridView.DataBind();

That't it! Because the DAL is a public class and the GetDataSet method
(like all the others) are static, nothing further is required. Any page in
the web app which needs database connectivity just calls one of the
methods in the DAL. GetDataSet, as its name suggests, returns a DataSet
object. Other methods in the DAL return an SqlDataReader, others perform
database writes, others wrap stuff in transactions, others work with
binary data etc.

Of course, the methods in the DAL are overloaded to accept a different
connection string from the default one (which is stored encrypted in
web.config), and also a List<SqlParametergeneric collection to support
parameterised stored procedures.

A relatively small investment in time and effort to set your base classes
up will allow you to whizz through the rest of the development cycle.

Where are you based, AAMOI...?

Oct 11 '06 #5
Thanks, i have often an issue with paramters and such.
Hopefully this code can handle paging.

"Guy Cohen" <no*****@please.comschreef in bericht
news:%2****************@TK2MSFTNGP02.phx.gbl...
Mark you are great!

Guy @ Israel
"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:uu**************@TK2MSFTNGP02.phx.gbl...
>"Guy Cohen" <no*****@please.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
>>My problem is that my boss wants the fastest solution from me and I am
not familiar with do(n)t net *blush*

Believe me, once you have all the base classes in place, this is by far
the best method of rapid robust development.

E.g. here's a basic GridView control:

<asp:GridView ID="MyGridView" runat="server">
...bound fields etc
</asp:GridView>

Let's say I have a stored procedure called "MyStoredProcedure" which
returns the data I need to populate the GridView. With my DAL, this is
how it gets populated:

MyGridView.DataSource = DAL.GetDataSet("MyStoredProcedure");
MyGridView.DataBind();

That't it! Because the DAL is a public class and the GetDataSet method
(like all the others) are static, nothing further is required. Any page
in the web app which needs database connectivity just calls one of the
methods in the DAL. GetDataSet, as its name suggests, returns a DataSet
object. Other methods in the DAL return an SqlDataReader, others perform
database writes, others wrap stuff in transactions, others work with
binary data etc.

Of course, the methods in the DAL are overloaded to accept a different
connection string from the default one (which is stored encrypted in
web.config), and also a List<SqlParametergeneric collection to support
parameterised stored procedures.

A relatively small investment in time and effort to set your base classes
up will allow you to whizz through the rest of the development cycle.

Where are you based, AAMOI...?


Oct 12 '06 #6
"Edwin Knoppert" <ne**@hellobasic.comwrote in message
news:45**********************@text.nova.planet.nl. ..
Thanks, i have often an issue with paramters and such.
Hopefully this code can handle paging.
Handles paging seamlessly.

And sorting.
Oct 12 '06 #7

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

Similar topics

2
by: Rob | last post by:
Hi, In the server explorer in Visual Studio.Net I'm able to design tables, create stored procedures, etc for the SQL 2000 database running locally on my computer. If I add a connection to a remove...
7
by: Mike Malter | last post by:
Visual Studio is giving me errors when trying to connect to a database server on my LAN. This has been working for years. Then this morning when I opened VS I went to the server explorer before...
0
by: Bill Thom | last post by:
I have a Microsoft Access 2000 (9.0.4402 SR-1) database that I am attempting to launch from a hyperlink using Internet Explorer (Version 6.0.2800.1106). If I attempt to launch the database from...
1
by: David | last post by:
Hello, I have the Visual Studio .NET installed under Windows XP Pro, in my laptop. Right now I practice C#, and I need an access to any available database. It seems that I can use the Server...
1
by: David | last post by:
Hello, I have the Visual Studio .NET installed under Windows XP Pro, in my laptop. Right now I learn C#, and I need an access to any available database, just for practice. It seems that I can...
8
by: David | last post by:
Hi, Could someone please xplain how to add a field to an existing SQL table in VB.Net I have added the field in the Server Explorer and it shows up when I reload the program but I cannot...
18
by: surfrat_ | last post by:
Hi, I am having the following problems in getting Microsoft Visual Studio 2005 Professional to link to an Access .mdb database. Please help me to sort this out. Problem 1: The Microsoft...
0
by: RAM | last post by:
Hi, (Sorry for my English...) I have such problem: if I use Database Explorer in Visual Studio I will not be able to connect from my application to the database; when I don't use Database...
3
by: dani kotlar | last post by:
I use a table adapter to add rows to a database, using Update(); After adding a row to the database and closing the application, if I run the application again, and call Fill(), I can see the new...
0
by: praveenb000 | last post by:
Hi frnds, i created a database in sqlserver management studio, and i know how to connect that database to the current project. but problem is when i change to another system(pc), i need to run...
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
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...
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,...
0
jinu1996
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...
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
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...

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.