.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Post New Web Links

Value member in a combo box

Posted By:      Posted Date: October 02, 2010    Points: 0   Category :Windows Application

I am trying to setup a combo box so when a user selects an item the code use's a ref number associated with the item to pull down data from the web via an API.

I was trying to use the "ValueMember" property but when loading the data in I can't get it to index, the value is always equal to the last value entered (10004 in the code below), is the "ValueMember" indexed or is it just a single value?




public Form1()





View Complete Post

More Related Resource Links

Combo Display changes to a Value Member


Hello, I have a problem with combo box at runtime,

I set up every bounding in design, when I run it, it updated everything fime , but it changes content of a combo to a value member.


Gmail style multiple Sign-in type combo...is it possible in asp.net?


I am developing a multi-company application and want my users to give the functionality like the following to switch companies.


Is this possible? then how?

Please help


Get Member from LDAP using C# 2.0


I'm currently writing a process where I need to determine if an User on my LDAP string is an Admin.

How can I accomplish this?  What would be the easy and quickest way?

I've been trying to use the code below..... Any feedback is greately appreciated. Tks



populate combo


i have two combo cboCountry and cboCity

i want to change cboCity with new value.

protected void cboCountry_TextChanged(object sender, EventArgs e)
            SqlCommand cmd = new SqlCommand("SELECT * FROM [Country] where country='" + cboCountry.SelectedItem + "'", new SqlConnection(ConfigurationManager.AppSettings["ConString"]));

            SqlDataReader ddlValues;
            ddlValues = cmd.ExecuteReader();

            cboCity.DataSource = ddlValues;
            cboCity.DataValueField = "City";
            cboCity.DataTextField = "City";


Comparing Enum values in a collection - BC42025: Access of shared member, constant member, enum mem


I am upgrading from asp1.1 to 2.0

I use collection classes to sort data (e.g in datagrids etc)


Enum newsFields
End Enum

Public Overloads Sub Sort(ByVal sortField As newsFields, ByVal isAscending As Boolean)
Select Case sortField
Case newsFields.title

How to connect the OledbCommand object with another Member Function

protected void GridViewTest_RowDeleting(object sender, GridViewDeleteEventArgs e)
       int deleteKey = Int32.Parse(GridViewTest.DataKeys[e.RowIndex].Value.ToString());
       OleDbCommand deleteCommand = new OleDbCommand();
       deleteCommand.CommandType = CommandType.StoredProcedure();
           deleteCommand.Parameters.AddWithValue("@empid", deleteKey);
 private DataTable  Connection1(string Storedprocedure)
       using (OleDbConnection MyConnection = new OleDbConnection(ConfigurationManager.AppSettings[0].ToString()))
           OleDbDataAdapter MyAdapter = new OleDbDataAdapter(Storedprocedure, MyConnection);
           DataTable MyTable = new DataTable();
           return MyTable;

Hello Members,

           I need one help..I Don't know how to connect the command object with
another Member function...
I tried something in the above code...But i got error...Please put me in right direction...


'CrystalReportViewer1' is not a member of 'ReportViewer'


Hello, I added a CrystalReportViewer control to my ReportViewer page and when I try to set the CrystalReportViewer1.ReportSource in code I get the error "'CrystalReportViewer1' is not a member of 'ReportViewer'". 

I noticed that some of our older projects reference CrystalDecisions.ReportAppServer.ClientDoc but I am unable to find that dll anywhere on my machine so this project does not reference it. 

Any ideas?




From 3.5 to 2.0: No default member found for 'DataTable'



I'm trying to change the framework of an application I made a while from 3.5 back down to 2.0 as it's not compatible with the new server we put in (we're don't have permission to install 3.5 framework).

So, I went into the project properties and under the Compile tab, changed the project to 2.0. When I tried to publish the project I got a lot of errors and warnings and the publish failed.

In the 3.5 code, I had SQLSelect statement in a Dim which was labeled 'As DataTable'. When switching to 2.0, an error appears on the Dim saying: "Class 'System.Data.DataTable' cannot be indexed because it has no default property". So I simply took DataTable out of the code. Now, when I try to run the project, I get "No default member found for 'DataTable'.

Here's the code:

Function DisplayName(ByVal LoginName)

     Dim tempname(2) As String
     Dim signon As String

     tempname = Split(CheckUser(LoginName), "\")
     singon = tempname(1)

     Dim rst 'As DataTable
     rst = ExecSQLSelect("SELECT given_name, surname FROM ... etc")

     If rst.Rows.Count = 0 Then
          DisplayName = "Unknown"

          'This is where the error is:
          DisplayName = rst(0)("giv

Class member autocomplete


Is there in C# such feature as in VB when you create some class which inherits some interface and after clicking Enter after line Inherits SomeInterfaceHere all properties and functions which you need to inherit appear?

DataContractSerializer deserialization puzzle - by-pass member initialization.

Hi, I was using WCF and during the transmission of a object, of the type Book, see code below, the deserialization process throws a NullReferenceException. To isolate the problem, I uses a unit test like this rather than involving the full blown WCF marshalling. This appears to be solely a serialization/deserialization problem and has nothing to do with the communication issues in WCF. [Test] public void TestSerializeAndDeserializeBook() {     Book book = new Book( "Testing Serialization and Deserialization",                         new Person( 100, "Tom", "Smith" ),                         new Person( 101, "Peter", "Pan" ) );     DataContractSerializer ser = new DataContractSerializer( typeof(Book) );     using( Stream stm = new MemoryStream() )     {         ser.WriteObject( stm, book );         stm.Seek( 0, SeekOrigin.Begin );         Book regen = ser.ReadObject( stm ) as Book; // NullReferenceException here     &nb

Adjacent combo boxes take space according to their data on google chrome

I have a page where I want to keep several combo boxes adjacent to each other. I have put them in divs that are floated left.This works fine in IE, Firefox. But when I render the same page on Chrome I observe the uneven gap between combo boxes. Upon analysis I found out that each combo box is occupying space based on the data inside it.This happens because on Safari and Chrome, the option list control is placed differently as compared to that on IE and Firefox.Please see the following code from ComboBox.pre.js (in AjaxControlToolkit source/Server/) // force inline display on Safari by moving the list to the bottom of the form. if (Sys.Browser.agent === Sys.Browser.Safari || Sys.Browser.agent === Sys.Browser.WebKit) { this.get_element().removeChild(optionListControl); var parent = this.get_element().parentNode; while (typeof (parent) != typeof (document.forms[0])) { parent = parent.parentNode } var safariListContainer = document.createElement('div'); safariListContainer.className = this.get_element().className; safariListContainer.appendChild(optionListControl); parent.appendChild(safariListContainer); } This is how it looks:I have tried doing the following but none of them helped:Changed the RenderMode of combo box to 'block' fro

LINQ to SQL compiler error CS1519: Invalid token 'void' in class, struct, or interface member decl

I get the following compiler errors when creating my first LINQ to SQL class (I just dragged a table "ProfileExtended" onto the designer and hit build):DataClasses.designer.cs(31,11): error CS1519: Invalid token 'void' in class, struct, or interface member declaration these are the offending lines of autogenerated code:#region Extensibility Method Definitions  partial void OnCreated();  partial void InsertProfileExtended(ProfileExtended instance);  partial void UpdateProfileExtended(ProfileExtended instance);  partial void DeleteProfileExtended(ProfileExtended instance);  #endregion

group member detail view

hi, i have add member group to my detail view. but it does not show the member group correclty. it shows a lot duplicated members. and members that are not in a group it shows that they are in the group. i know you can not modify the wss_conten database. how can i still use group member in dataview?

PeriodsToDate problem with calculated member

Hi I've come across an example where my calculated member will yield wrong results. I've been trying in the last few days to find a solution for this, but so far no luck. I have two measures: [Measures].[Marketing Spending (Actual)]: Aggregation: Sum [Measures].[New Subscriptions (Actual)]: Aggregation: Sum Then I created following calculated member in the schema: [Measures].[CPA (Actual)]=[Measures].[Marketing Spending (Actual)]/[Measures].[New Subscriptions (Actual)] If I run a query like this I get the correct results: SELECT [Measures].[CPA (Actual)] ON 0 from [Global B2C Weekly KPI Cube] WHERE [Date.Weekly Calendar].[2010].[1]:[Date.Weekly Calendar].[2010].[32] I can even add some other dimensions and all looks fine. But, when I create a calculated Member in the MDX query with PeriodsToDate and Aggregate, the results looks like the sum of the CPAs by week. WITH MEMBER [Measures].[x] AS Aggregate(PeriodsToDate([Date.Weekly Calendar].[2010],[Date.Weekly Calendar].[2010].[32]),[Measures].[CPA (Actual)]) SELECT [Measures].[x] ON 0 from [Global B2C Weekly KPI Cube] So my take is that as PeriodsToDate gives back all the members, the calculated measure is calculated for each member and then summed up.  In this case the measures should be summed first for the time period and then the calculation should be performed. I don't want to create extra memb

Performance Problems with calculate member in a cube

Hi,  I'm having performance issue with calculated member (Running total) which is created on one dimension in the cube.  Cube is having three dimension Product Details(Product Model, Product Type) , Time(Year & Month) & Qty type(In Qty & Out qty). See below for details Dimtime Year (Values 2000 to 2020) Month DimProd Product No Product Type Product Group DimQty Type In Qty Out Qty Fact Table Product No Year Month Qty Type of Qty( In Qty or Out Qty ) My MDX query for calculated member is  CREATE MEMBER [Qty Type].[Qty Type].[All].[Total] as      SUM(NULL:[TimeDim].[Hierarchy].CurrentMember , ([Qty Type].[Qty Type].[In Qty], Measures.[Qty]) - ([Qty Type].[Qty Type].[Out Qty], Measures.[Qty])  The formula is --> Total = Previous Period Total Qty + Inqty - Out Qty   This works perfectly when i browse at higher level (Qty Type on Rows & Time On Columns),   but when  i browse the cube adding dimension Product Details( Product group or Product Type) to Drill-through the In Qty & Out Qty,  the query is running and after one hour also it's not finished. Can anyone help me to solve this or propose new structure to resolve this issue.   

MDX Query - Get (Parent-Child) Dimension member regarding another Parent-Child Dimension, then, get

Hi there, I got the following MDX issue. My cube structure looks like that : DIMENSION CATEGORY (Parent-Child) --> (Many to many) FCTLESS_CategoryNode <-- DIMENSION NODE (Parent-Child) ___ DIMENSION NODE (Parent-Child) --> (Many to many) FCTLESS_NodeVariable <-- DIMENSION VARIABLE ___ DIMENSION VARIABLE <-- FACT (Supposed with only one value called VALUE) I'd like aggregate for N nodes linked to a specific category. For example, with the next content : DIMENSION CATEGORY - COUNTRY - SITE - BUILDING DIMENSION NODE US (Category Country)     - Site US_A (Category Site)     - Building US_A_A  (Category Building) FR (Category Country)     - Site FR_A (Category Site)     - Building FR_A_A  (Category Building)                                       - Site FR_A (Category Site)     - Building FR_A_B  (Category Building)                                       - Site FR_B (Category Site) 

Cannot create user: server cannot determine if it is member of a domain

Hi, An instance of our 2008 SP1 SQL Server is running on a computer that was removed from it's domain and then re-added. Now, when I want to create a new login in Management Studio via the nodes Security/Logins, selecting "New Login", entering DOMAIN_NAME\USER_NAME as login name and then click "Search", I get an error message (in German) "Das Programm kann das erforderliche Dialogfeld nicht öffnen, da nicht ermittelt werden kann, ob Computer "COMPUTER_NAME" einer Domäne zugeordnet ist. Schließen Sie dieses Dialogfeld, und wiederholen Sie den Vorgang". Translation: "The program cannot open the required dialog, as it cannot be determined if computer "COMPUTER_NAME" is assigned to a domain. Close this dialog, and repeat the process." But closing the dialog and repeating as suggested does not help. Even restarting the SQL Server service and re-connecting in Management Studio did not help. I keep getting this message. I found, however, that just entering the domain and user name and then clicking Ok seems to add the user. Anyway, it is irritating to get this error message when clicking "Search". How can I tell the engine that the computer is really member of the domain again? Frank
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend