Control for DB + SP's?

L

Lasse Edsvik

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
 
K

Ken Dopierala Jr.

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()
 
J

John Saunders

Lasse Edsvik said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top