Showing posts with label control. Show all posts
Showing posts with label control. Show all posts

Friday, March 30, 2012

multi-value dropdownlist as a .net control?

Does anyone know if I can utilize the same multi-value dropdownlist control that is available in Report Manager and the ReportViewer parameters section, in my own ASPX pages? This is the control that has checkboxes in a dropdown list.

If not, can anyone point me to a third party?

Thanks,

Brian

Brian,
know exactly what you are talking about as I was searching for an item like this myself. I have not found any similar control yet but managed to seperate the client side code that is driving the control in the ReportViewer. Did not have time to write a custom control that renders out this client side code but this is definitely doable. Let me know if you want to have the commented client side code that drives the dropdown (it does not work in Firefox though but should be good enough as an example).

Cheers,
Niels

multi-value dropdownlist as a .net control?

Does anyone know if I can utilize the same multi-value dropdownlist control that is available in Report Manager and the ReportViewer parameters section, in my own ASPX pages? This is the control that has checkboxes in a dropdown list.

If not, can anyone point me to a third party?

Thanks,

Brian

Brian,
know exactly what you are talking about as I was searching for an item like this myself. I have not found any similar control yet but managed to seperate the client side code that is driving the control in the ReportViewer. Did not have time to write a custom control that renders out this client side code but this is definitely doable. Let me know if you want to have the commented client side code that drives the dropdown (it does not work in Firefox though but should be good enough as an example).

Cheers,
Niels

Friday, March 9, 2012

Multiple SqlDataSource Controls on a Page

Thanks for your help.

I'm just getting into ASP.NET 2.0 and started using the SqlDataSource control to declaritively connect to a database. I was wondering if I have two SqlDataSource controls on one page with two select commands querying the same database, will the that create to seperate instances of opening and closing the connection to the database, or will it open the database once, execute both queries, and then close the connection. It seems that if it creates two separate connections, it would still be more efficient to to connect to the database programmatically using ADO.NET. You would only need to make one trip to the database, pull down all of your data, and then close the connection.

Adrian

I believe it will open two connections. Which is what you would probably want anyhow. That would allow SQL Server to prioritize and minimize response time.

That said, most of the time you can write code to do things more efficiently than depending on a generic library. It's a trade off, and often the code you may generate may not actually be more efficient unless you are also able to spend the time to implement the more advanced features of the library, in this case, the controls ability to selectively databind and cache data.

Saturday, February 25, 2012

Multiple Servers in ODBC Client Setup

OK, something weird is happening.
I have a standard Windows XP client and I am trying to set up a simple ODBC
entry. So I go to Control Panel/Administrative Tools/ODBC/System Tab. From
there I create a new ODBC entry connecting to a SQL Server. I enter in the
name of my ODBC and a descripton. When I hit the drop-down button to select
a server I see my 2 SQL Server machines (local machine also named "Jim" and
sbserver) but they are listed twice or even 3 times (see below) and the local
machine has even more entries. What gives and how do I clean this up? Both
seem to work when I "test" at the last step but I have a local application
using this ODBC and it is failing to run so I think it is having "issues"
with these multiple entries.
Thanks!
-Richard
e.g.
(local)
(local)
Jim
Jim
jim
sbserver
sbserver
Make sure your MDAC installation isn't flaky - you can use
component checker to verity the MDAC version and
installation. You can download the tool from:
http://msdn2.microsoft.com/en-us/data/aa937730.aspx
How many instances do you have on each of those servers?
Do you get the same list if you execute the following from
the command prompt:
osql -L
-Sue
On Fri, 16 Mar 2007 04:47:05 -0700, Richard K
<RichardK@.discussions.microsoft.com> wrote:

>OK, something weird is happening.
>I have a standard Windows XP client and I am trying to set up a simple ODBC
>entry. So I go to Control Panel/Administrative Tools/ODBC/System Tab. From
>there I create a new ODBC entry connecting to a SQL Server. I enter in the
>name of my ODBC and a descripton. When I hit the drop-down button to select
>a server I see my 2 SQL Server machines (local machine also named "Jim" and
>sbserver) but they are listed twice or even 3 times (see below) and the local
>machine has even more entries. What gives and how do I clean this up? Both
>seem to work when I "test" at the last step but I have a local application
>using this ODBC and it is failing to run so I think it is having "issues"
>with these multiple entries.
>Thanks!
>-Richard
>e.g.
>(local)
>(local)
>Jim
>Jim
>jim
>sbserver
>sbserver

multiple selection listbox as data control?

Hi, i have a listbox with multiple selection enabled, the end user uses this listbox to select what data they want to view eg. they select "green" to view all the green cars, "red" to select all the red cars etc.

i have the listbox as the control that is connected to the datasource (the sql used for it isselect * from cars_table where color =@.color

this works fine when one item in the listbox is selected, but when multiples are selected it does not work

what format does the=@.colorhave to be when multiples are selected? i've tried "green, red" "green + red" etc. but cannot seem to get it working

does anybody have any working examples that i can take a look at? it seems to be a common action, yet i cannot seem to find any documentation on how to get it to work

thanks in advance!

You will have to iterate through the selections and dynamically build your SQL

foreach (ListItem itemin ListBox1.Items)
{
if(item.Selected)
{
sql += " Or color = '" + item.Text +"'";
}
}