473,671 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I bind values to a drop-down User Control?

Hi,

I've made a User Control with a drop-down list box (OK, copied it out of a
book). It binds to a SQL statement which links to my database. All the code
is in the ascx.vb file.

Now I want to make a User Control drop-down list box that only has two
values, "Yes" and "No". That way I can use it in multiple places (that is
the right idea?). I just can't figure out how to do this using VS2003 and
VB. I am originally an Access user, so I think my head may be stuck in that
mode.

Can this be done, or should I make a table containing two values and link to
that? Although that seems silly to me.

Thanks for the help.


Nov 18 '05 #1
2 2207
You could create a UC for this, but IMO this is overkill for a simple yes/no
radiobutton.

You could consolidate it to a single checkbox (checked = yes, unchecked =
no)... and tie this to a BIT field in SQL Server/Access.
"Rob G" <gu*******@hotm ail.com> wrote in message
news:10******** *****@corp.supe rnews.com...
Hi,

I've made a User Control with a drop-down list box (OK, copied it out of a
book). It binds to a SQL statement which links to my database. All the code is in the ascx.vb file.

Now I want to make a User Control drop-down list box that only has two
values, "Yes" and "No". That way I can use it in multiple places (that is
the right idea?). I just can't figure out how to do this using VS2003 and
VB. I am originally an Access user, so I think my head may be stuck in that mode.

Can this be done, or should I make a table containing two values and link to that? Although that seems silly to me.

Thanks for the help.

Nov 18 '05 #2
Thanks for the info. For some reason, I never thought of using the checkbox.
It makes much more sense.

I guess my head has been in the books for too long.
"Elliot M. Rodriguez, MCSD" <elliotmrodrigu ezathotmaildotc omspam> wrote in
message news:uS******** ******@TK2MSFTN GP10.phx.gbl...
You could create a UC for this, but IMO this is overkill for a simple yes/no radiobutton.

You could consolidate it to a single checkbox (checked = yes, unchecked =
no)... and tie this to a BIT field in SQL Server/Access.
"Rob G" <gu*******@hotm ail.com> wrote in message
news:10******** *****@corp.supe rnews.com...
Hi,

I've made a User Control with a drop-down list box (OK, copied it out of a book). It binds to a SQL statement which links to my database. All the code
is in the ascx.vb file.

Now I want to make a User Control drop-down list box that only has two
values, "Yes" and "No". That way I can use it in multiple places (that is the right idea?). I just can't figure out how to do this using VS2003 and VB. I am originally an Access user, so I think my head may be stuck in

that
mode.

Can this be done, or should I make a table containing two values and

link to
that? Although that seems silly to me.

Thanks for the help.


Nov 18 '05 #3

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

Similar topics

2
31396
by: Jack | last post by:
Hi All, What is the PHP equivilent of Oracle bind variables in a SQL statement, e.g. select x from y where z=:parameter Which in asp/jsp would be followed by some statements to bind a value to :parameter I dont like the idea of making the SQL statement on the fly without binding parameters as I dont want a highly polluted SQL cache.
1
25562
by: Achille Carette | last post by:
Hello all, I noticed a difference in the explain plans between JDBC using bind variables (PreparedStatement) and SQLPlus for the same query. The query made through JDBC using bind variables makes a full table scan, while the query made in SQLPlus, replacing the "?" by string literals uses an index. (Platform: Oracle 10.1 / Linux RedHat 9 / JDK 1.4.2 / Oracle 10g thin JDBC driver ) As a common practice is to write and optimize queries...
1
4676
by: Daniel Roy | last post by:
Hi gurus, I just started to look at a very slow-running SQL statement generated by an application (Siebel). I spooled the SQL from the application, replaced the bind variables by their values, and tuned from the Query Analyser. But after awhile, I realized that the statement using bind variables and the same statement using the values instead of the bind variables often have completely different execution plans! Is that normal? Can...
3
1971
by: troy.forster | last post by:
I am sure this must be about the simplest thing to do. I can whip something off in 10 different languages and environments with no problem. But VisualStudio 2003 and ASP.NET is sooooo frustrating!!! My example is simple. I have an Access table (mytable) with two fields of type text (userid and password). I want to display a dropdownlist on a page and have it list the userids. Nothing more.
0
1065
by: Webbyz | last post by:
Here is my problem. I have 2 fields fSeason and rSeason in my database. These hold the String values of either Spring or Fall. I have a comboBox in my form that i am trying to bind on load to these fields. DB Table = referee DB Fields I am working with = fSeason / rSeason The values of Spring and Fall are manually entered into the collections
1
9249
by: john wright | last post by:
I have a dictionary oject I created and I want to bind a listbox to it. I am including the code for the dictionary object. Here is the error I am getting: "System.Exception: Complex DataBinding accepts as a data source either an IList or an IListSource at System.Windows.Forms.ListControl.set_DataSource(Object value)
0
2178
by: lnd | last post by:
A few question regarding PostgreSQL handling of queries: - Is each query submitted parsed and planned even if it is identical to a query submitted before? For example, 10 queries "select * from animals where id=:b1" with possibly different bind variable :b1 values will be fully processed (parsed and planned) 10 times? - does it make difference for postgreSQL performance if bind variables are used or not?
14
25256
by: DaTurk | last post by:
I am makeing a Multicast server client setup and was wondering what the difference is between Socket.Connect, and Socket.Bind. It may be a stupid question, but I was just curious. Because I tried a test, and I can't bind two sockets to the same port/ip but I can connect with one socket, and bind with another to the same ip/port. Thanks
2
24551
by: John Grandy | last post by:
Is it possible to bind a Dictionary to a DropDownList ? The most obvious code fails : Dictionary<string,stringdictionary = new Dictionary<string,string> dictionary.Add("Name1","Value1"); //add some more items ... DropDownList.DataSource = dictionary;
6
6270
by: pretzla | last post by:
I have a PL/SQL script where I load data from a stored procedure into bind variables. Then, I insert that data from the bind variables into an Oracle table with a simple insert statement. The execution of the stored procedure and the insert are in a FOR-LOOP. insert into ccd_t (acct_id, acct_seq_no, acct_btn) values
0
8472
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8390
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8909
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8819
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8667
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6222
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4221
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2806
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2048
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.