Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Control for DB + SP's?

Reply
Thread Tools

Control for DB + SP's?

 
 
Lasse Edsvik
Guest
Posts: n/a
 
      09-22-2004
Hello

I was wondering if you guys could give me some pointers on how to get where
i want to I know asp in and out, but havent tried asp.net that much.

when i build asp apps i always use OleDB provider and Stored procedures
which I in most cases pass parameters to... which i imagine you've done a
million times too....

anyway..... was wondering how to create a control (?) to make it as easy to
use as:
....
<psuedocode>

Something db = new Something();
db.Command "MySP";
db.Setparameter("@Parm1",var1);
db.Setparameter("@Parm2",var2);
db.Execute();

</psuedocode>

I've looked at some OleDb tutorials and its just too much...... cant imagine
it has to take like 100 lines of code to do something trough the oledb
provider......

I'd appreciate any help
TIA
/Lasse



 
Reply With Quote
 
 
 
 
Ken Dopierala Jr.
Guest
Posts: n/a
 
      09-22-2004
Hi Lasse,

This is an example of what I use for SQL. You should be able to just change
the SQL stuff to OleDB. Good Luck! Ken.

Dim objConnection As New SqlConnection(strDSN)
Dim objDS As New DataSet()
Dim objDA As New SqlDataAdapter()
Dim objCommand As New SqlCommand()

objCommand.CommandText = "WS_Quote_GetQuoteHistory"
objCommand.CommandType = CommandType.StoredProcedure
objCommand.Connection = objConnection
objConnection.Open()
objDA.SelectCommand = objCommand
objCommand.Parameters.Add("@CarrierID", SqlDbType.Int).Value =
intCarrierID
objCommand.Parameters.Add("@StartDate", SqlDbType.DateTime).Value =
dtStartDate
objCommand.Parameters.Add("@EndDate", SqlDbType.DateTime).Value =
dtEndDate
objDA.Fill(objDS, "ActiveQuotes")
objConnection.Close()

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight

"Lasse Edsvik" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello
>
> I was wondering if you guys could give me some pointers on how to get

where
> i want to I know asp in and out, but havent tried asp.net that much.
>
> when i build asp apps i always use OleDB provider and Stored procedures
> which I in most cases pass parameters to... which i imagine you've done a
> million times too....
>
> anyway..... was wondering how to create a control (?) to make it as easy

to
> use as:
> ...
> <psuedocode>
>
> Something db = new Something();
> db.Command "MySP";
> db.Setparameter("@Parm1",var1);
> db.Setparameter("@Parm2",var2);
> db.Execute();
>
> </psuedocode>
>
> I've looked at some OleDb tutorials and its just too much...... cant

imagine
> it has to take like 100 lines of code to do something trough the oledb
> provider......
>
> I'd appreciate any help
> TIA
> /Lasse
>
>
>



 
Reply With Quote
 
 
 
 
John Saunders
Guest
Posts: n/a
 
      09-22-2004
"Lasse Edsvik" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello
>
> I was wondering if you guys could give me some pointers on how to get
> where i want to I know asp in and out, but havent tried asp.net that
> much.
>
> when i build asp apps i always use OleDB provider and Stored procedures
> which I in most cases pass parameters to... which i imagine you've done a
> million times too....
>
> anyway..... was wondering how to create a control (?) to make it as easy
> to use as:
> ...
> <psuedocode>
>
> Something db = new Something();
> db.Command "MySP";
> db.Setparameter("@Parm1",var1);
> db.Setparameter("@Parm2",var2);
> db.Execute();
>
> </psuedocode>


Take a look at how this is done in ASP.NET 2.0 with Data Source Controls.

John Saunders


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
User Control to Control Other User Control Jonathan Wood ASP .Net 4 02-02-2010 03:41 PM
Control, Web Control and Composite Control shapper ASP .Net 6 12-26-2007 02:49 PM
persisting changes to a control outside a user control from the user control? Mad Scientist Jr ASP .Net 0 03-22-2006 08:02 AM
HTML Client Control versus. HTML Server Control versus. Web Server Control Matthew Louden ASP .Net 1 10-11-2003 07:09 PM
Using Table control in a custom composite control. Control does not render properly in design time. jb_in_marietta@yahoo.com ASP .Net 0 07-01-2003 09:26 PM



Advertisments