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

SQL 2000 & ASP.NET/Visual Studio 2005

What is the best way to edit records on a form using ASP.NET(VB.NET) in
VS2005 connecting to SQL 2K database? Is just mapping text boxes to
data? Or are there any new methods of doing that?

Dec 20 '06 #1
3 850
The best way, and safest from a security perspective, is to use stored
procedures. This enables you to pass parameters to the db instead of using a
method that may simply end up concatenating a string together. With the
parameters, you can mitigate the use of a sql injection attack. It's also a
bit better because the parameters are typed whereas all the textbox values
are initially strings until you convert them, and passing the wrong type to
a parameter will at least throw an informative error. The performance of a
stored procedure is also better since the database will be able to optimize
the procedure and cache the optimization for future use.

--

Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"No_Spam" <no********@comcast.netwrote in message
news:11*********************@i12g2000cwa.googlegro ups.com...
What is the best way to edit records on a form using ASP.NET(VB.NET) in
VS2005 connecting to SQL 2K database? Is just mapping text boxes to
data? Or are there any new methods of doing that?

Dec 21 '06 #2
You can speed it up a bit by dragging the table onto the form and consuming
that data. It will create all of the adapters for you. It is not necessarily
the best, from an Enterprise standpoint, but it works rather well for many
sites for small and medium businesses. If you want to be a bit more correct,
a DataSet with a table adapter works nicely.

I will both agree and disagree with part of Mark's statement. The sproc
(stored procedure) version of database access is easier to secure, but you
can get similar security using parameterized queries in a tableAdapter, so
the main security is not what Mark states. When you drag data onto a form,
it is automatically parameterized, eliminating SQL injection.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

********************************************
Think outside the box!
********************************************
"No_Spam" <no********@comcast.netwrote in message
news:11*********************@i12g2000cwa.googlegro ups.com...
What is the best way to edit records on a form using ASP.NET(VB.NET) in
VS2005 connecting to SQL 2K database? Is just mapping text boxes to
data? Or are there any new methods of doing that?
Dec 21 '06 #3
Thanks for pointing that out Gregory. I stopped using the VS designer
because I didn't like the code bloat in VS 02. Now I'm just as fast
hand-coding and templating it I haven't bothered to check out any of the
designer features in VS 2005. Do you know of any other good time-saving db
shortcuts in the VS designer that are worth examining?

Mark

"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamMwrote in
message news:82**********************************@microsof t.com...
You can speed it up a bit by dragging the table onto the form and
consuming that data. It will create all of the adapters for you. It is not
necessarily the best, from an Enterprise standpoint, but it works rather
well for many sites for small and medium businesses. If you want to be a
bit more correct, a DataSet with a table adapter works nicely.

I will both agree and disagree with part of Mark's statement. The sproc
(stored procedure) version of database access is easier to secure, but you
can get similar security using parameterized queries in a tableAdapter, so
the main security is not what Mark states. When you drag data onto a form,
it is automatically parameterized, eliminating SQL injection.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

********************************************
Think outside the box!
********************************************
"No_Spam" <no********@comcast.netwrote in message
news:11*********************@i12g2000cwa.googlegro ups.com...
>What is the best way to edit records on a form using ASP.NET(VB.NET) in
VS2005 connecting to SQL 2K database? Is just mapping text boxes to
data? Or are there any new methods of doing that?

Dec 21 '06 #4

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

Similar topics

15
by: Geoff Cox | last post by:
Hello, Can I separately declare and initialize a string array? How and where would I do it in the code below? It was created using Visual C++ 2005 Express Beta 2 ... In C# I would have ...
1
by: Philip Leduc | last post by:
Hi there, I am a MS Access VBA programmer trying to get my feet wet using VB.net / SQL server. I have SLQ 2000/visual studio 2003 loaded and did get a SQL2005/visual studio 2005 software...
3
by: dean4if | last post by:
I have 4 Windows 2000 Servers. I have installed the DotNet Framework 2.0 on all 4 servers. Three of these servers show a tab for ASP.NET in the IIS MMC and are running Visual Studio 2003. ...
0
by: rmk | last post by:
How can I get the 2000 and 2005 versions of SQL Server Reporting Services both working on my development laptop ????? I have ASP.NET 1.1 and 2.0 installed on my laptop. I have Visual Studio...
1
by: rmk | last post by:
How can I get the 2000 and 2005 versions of SQL Server Reporting Services both working on my development laptop ????? I have ASP.NET 1.1 and 2.0 installed on my laptop. I have Visual Studio...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
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
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...
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.