473,320 Members | 1,930 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.

Set SqlDataSource in code behind

Hello!

I would like to set the SqlDataSource in the code behind file and not
to have it in the aspx file. How can I do that?

Regards,

Staeri

Jan 11 '06 #1
1 1860
Instantiate a SqlDataSource object in your code, probably in your
code-behind.

SqlDataSource sdsData = new SqlDataSource();

There are two other constructors for SqlDataSource. Look at the MSDN
documentation for more information.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

<st****@gmail.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
Hello!

I would like to set the SqlDataSource in the code behind file and not
to have it in the aspx file. How can I do that?

Regards,

Staeri

Jan 12 '06 #2

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

Similar topics

5
by: Martin Bischoff | last post by:
Hi, is it possible to modify the values of a SqlDataSource's select parameters in the code behind before the select command is executed? Example: I have an SqlDataSource with a...
15
by: Swetha | last post by:
Hello I have a DropDownList that I am populating using the following SqlDataSource: <asp:DropDownList ID="parentIDDropDownList" runat="server" DataSourceID="SqlDataSource3"...
2
by: prontoo | last post by:
Hello, I dont know how to get a recordset from sqldatasource with selectcommand and put in standard listbox (not html) when i press the standard button. Thank you
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...
2
by: phil | last post by:
Hi, I want to put a recordset in a gridview but i don't know how to pass the value of the variable in the 'where' statement. The value of the variable is set in the code-behind. i added a tag...
4
by: Casper | last post by:
Hi, i know how to use datareader in code-behind, e.g. like this: Dim oConnection As OleDbConnection Dim comd As OleDbCommand Dim dtreader As OleDbDataReader oConnection = New...
1
by: John Kotuby | last post by:
Hello again... I have tried using the SQLDatsource control as part of a user control that just conatins a Repeater and the SQLDatasource control which is designated as the Datsource for the...
1
by: Vili | last post by:
Hi all I would like to get some ideas and opinions of my solution for dataconnection on asp.net 2.0 I have created a class which encapsulates the sqldatasource usage. With my class one can...
3
by: markpringle | last post by:
This is my sqldatasource this is on the page: <asp:sqldatasource runat="server" ID="DS_CheckUserName" ConnectionString="<%$ ConnectionStrings:SQL2005_355184_ConnectionString %>" ...
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: 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...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
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: 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.