473,320 Members | 2,000 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,320 software developers and data experts.

sqlDataSource how to work with it ?

Hey
I have storedProcedure that takes 1 param. And I have checkBoxList that I
want to bind to sqlDataSource. The parameter needed for stored procedure is
in gridView.DataKey ( diffrent for every row ). So ... how to connect it.
Jarod

Jan 26 '06 #1
2 1482
What is the single parameter type? XML?

The checkbox list gives you n options (from 0 to every row). If the
parameter is typed as an int, for example, which value are you going to send?
You have to digest the information and send to the parameter.

Options:
Comma Separated List - forces dynamic SQL compile in the stored procedure,
which is not wise, or cursing through the list and creating a temp table to
join to for output. Also a bit kludgy.

XML - Forces you to digest the information up front before sending in (Can
be encapsulated in a method, however). XML is a bit slower than a temp table,
but is an area Microsoft has focus on.

UpdateGram (or native ADO.NET) - can use the updateability of the DataGrid.
This only works well if the checkbox list checked values are represented as a
separate datatable in your DataSet. Otherwise you have a great bit of coding.
Note, however, that this particular option can be fully declarative, if you
wish to play that way; to do this, you need additional DataTables to
represent both the full list and the chosen values. Hope this makes sense.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"Jarod" wrote:
Hey
I have storedProcedure that takes 1 param. And I have checkBoxList that I
want to bind to sqlDataSource. The parameter needed for stored procedure is
in gridView.DataKey ( diffrent for every row ). So ... how to connect it.
Jarod

Jan 26 '06 #2
> The checkbox list gives you n options (from 0 to every row). If the
parameter is typed as an int, for example, which value are you going to
send?
You have to digest the information and send to the parameter.

I don't want to send it I want get data from database. When my gridView is
binding I need to update checkboxList with data.
Jarod

Jan 26 '06 #3

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

Similar topics

8
by: Mike Kelly | last post by:
I've chosen to implement the "optimistic concurrency" model in my application. To assist in that, I've added a ROWVERSION (TIMESTAMP) column to my main tables. I read the value of the column in my...
3
by: adam222 | last post by:
hello, i have a web-form with a GridView control, i wanted to update & delete, using the AutoGenerateEditButton. when i used it with sqlDataSource (executing SP in the DB) it works like a...
3
by: Dorte | last post by:
Hi, Could someone help me with a couple of links to SqlDatasource documentation on how to use the Gridview and SqlDatasource components in code behind? Basically I'm missing some documentation...
0
by: cyberbless | last post by:
I would like to dynamically assign a Select Statment to a a SqlDataSource. Problem is the SqlDataSource.Select() Command requires a "dataSourceSelectArgument" as one of its arguments. 1. What...
5
by: msch-prv | last post by:
Hi, I am trying to tie a SQLDataSource control to MySQL without success. The connection string works ok with an ObjectDataSource. (Native asp.net 2.0 MySQL dll loaded in /bin) For some reason,...
1
by: ASF | last post by:
I have a 2.0 framework page that has several texboxes, a gridview, and a sqldatasource. The user enters criteria in the textboxes, clicks a button, and the gridview displays the appropriate data....
2
by: djc | last post by:
1) I am wondering if I should be using an sqlDataSource object for my particular scenario. I need to loop through a listbox and perform an INSERT sql operation for each item. Could be a few or...
0
by: danielhamd | last post by:
I am converting a website that uses an Access Database to SQL Server. On one particular SqlDataSource I am having a lot of trouble. Here is the original: <asp:SqlDataSource ID="SqlDataSource1"...
4
by: mohaaron | last post by:
This seems like it should be simple to do but for some reason I have been unable to make it work. I would like to databind a SqlDataSource to a GridView during the click event of a button. This...
3
by: Mechanic | last post by:
I set up a Server 2003 R2 64-bit server to run ODP.NET.... That all works fine in 32-BIT mode except 1 thing. When I use asp:SqlDataSource tag on this machine I get this error. This application...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.