|
ComboBox2.ValueMember = <yourkeyvalue>
In combobox2_selectindexchanged(...) get the key value and look it up in your table.
Hope this helps...
Bill
|
|
|
|
|
Thanks.
When looking up the value in the table I use a For Next loop to go row by row until I find the sought after row. That works but is there a better way to do this?
|
|
|
|
|
I have a combobox on a form with the following code:
ComboBox2.DataSource = DataSetMainWindowStatusCodes1
ComboBox2.DisplayMember = "statuscodes.name"
ComboBox2.ValueMember = "statuscodes.statuscodesid"
When an item is selected in the combobox the following code runs:
DataViewUserNames.RowFilter = "departmentsid=" & ComboBox2.ValueMember.ToString
This code throws the error "Cannot find column [statuscodes.statuscodesid]"
If I use this code instead it works fine:
DataViewUserNames.RowFilter = "departmentsid=" & "1"
How can I use the ComboBox2.ValueMember for the DataViewUserNames.RowFilter?
Thanks in advance for any help on this issue.
|
|
|
|
|
dptalt wrote:
ComboBox2.ValueMember = "statuscodes.statuscodesid"
dptalt wrote:
ComboBox2.ValueMember.ToString
So you set the property to be statuscodes.statuscodesid, then you asked for it back, and it hasn't changed.
dptalt wrote:
How can I use the ComboBox2.ValueMember for the DataViewUserNames.RowFilter?
Get the value of the selected item, instead of the valuemember name itself.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks, that helped.
(I'm a newbee migrating from FoxPro.)
|
|
|
|
|
I have a single selection ComboBox with only 4 entries which is contained in a VSFlexGrid. I need to have the ability to replicate 1 of the selected entries across several of the rows. It will show up correctly if I manually click within each of the affected cells. Can this be automated???
|
|
|
|
|
Anyone out there know a slick way to get a label to display a decimal numeric value, limiting the value to only 1 decimal place to the right of the decimal? I.e.- show 125.5 instead of 125.5665 I've tried designating as currency and single but the only way I've limited at all was to assign the numeric value to a string with limited length, i.e.- x as string * 5. But while this correctly displays the 125.5 it also allows something like 32.34 to display as well.
Any thoughts?
Will
|
|
|
|
|
Dim MyDecimal As Double = 125.5665
MyLabel.Text = MyDecimal.ToString("#.#")
will display 125.6
********************************************
Dim MyDecimal As Double = 125
MyLabel.Text = MyDecimal.ToString("#.#")
will display 125
********************************************
Dim MyDecimal As Double = 125.5665
MyLabel.Text = MyDecimal.ToString("#.0")
will display 125.6
********************************************
Dim MyDecimal As Double = 125
MyLabel.Text = MyDecimal.ToString("#.0")
will display 125.0
|
|
|
|
|
You ROCK!
Thank you so much for the assistance!
Don't suppose you know what size I should make my forms so they fit PDA screen? I know my PDA has a 240x320 pixel screen but the form sizes in twips. Can't figure out the conversion.
Thanks again for the decimal solution.
Will Wingfield
The ResQ Shop
|
|
|
|
|
If you are using VB.NET which I assume from your previous post, then all control sizes should already be expressed as pixels. VB.NET does not support any coordinate system other than pixels.
In VB6 there are TwipsToPixelsX and TwipsToPixelsY functions that will convert twips to pixels based on the current screen resolution.
|
|
|
|
|
How do I get a list of the machine names of all the machines connected to my network?
Thanks in advance
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
Why on earth would anyone vote on a question asked?
...Is it so obvious that I'm stupid for asking the question?
Mad stuff.
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
how to use stored procedures in acces, coding
|
|
|
|
|
Access is not a Relational Data Base.
forget the stored procedures, views, triggers and so on, they don't exist...
(and consider also your reasons of using such software instead of a real RDBMS)
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Access does not have "Technically" such a thing as Stored Procedures or Views, but, it allows you to treat your Queries as "such" I am assuming that you do not want to have the SQL text in your code, and that you have created the corresponding Query in your Access DB.
To call an existing query, you can use this:
Command.commandtext = "[Query name]"
DO NOT FORGET THE []
If you are using parameters, your must create and append them to the command object before the .Execute call.
|
|
|
|
|
I have an aspx page("for generating report") in which i have 4 table tags("" for heading of report etc.) and the rows and cells to them are dynamically created based on the values retrieved from database in the form od dataset which results 4 tables. For ex:
Dim HeaderRow = New HtmlTableRow
Dim HeaderCell = New HtmlTableCell
HeaderCell.Height = "5"
HeaderCell.Attributes.Add("ALIGN", "center")
HeaderCell.Attributes.Add("CLASS", "ins-popupheader")
HeaderCell.InnerText = ds.Tables(0).Rows(0)("Title") & " - Content Report"
HeaderRow.Cells.Add(HeaderCell)
tblHeader.Rows.Add(HeaderRow)
Now the problem is.... I have an anchor tag on my report page "Export as CSV" on click of which I need to export the contents of the page to an Excel sheet.
I tried with the following code:
Response.ContentType = "application/vnd.ms-excel"
Response.AppendHeader("Content-Disposition", "attachment;filename=Ebom.xls")
Dim dsExport As DataSet = Session("Contentds")
Dim tw As New System.IO.StringWriter
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
Dim dgGrid As New DataGrid
Dim i As Integer = 0
For Each table As DataTable In dsExport.Tables
dgGrid.DataSource = dsExport.Tables(i)
dgGrid.DataBind()
dgGrid.RenderControl(hw)
i = i + 1
Next
' Write the HTML back to the browser.
Response.Write(tw.ToString())
' End the response.
Response.End()
It generates an Excel sheet but the format is not clear and I am missing some contents of my report page. I request if any one can help me in directly exporting the contents of my report page to Excel.
A quick response is appreciated........
Thanking in anticipation
--smitha
Smitha Bavandla
|
|
|
|
|
HOW Can i do Editable Listview?
|
|
|
|
|
I extended datagridtextboxcolumn class. When u click f5 button a special calculator form is opened as modal form. But when u close the calculator presssing OK button there is no problem; if u press cancel the focus is lost from the cell and datagrid. Why does it cause?
|
|
|
|
|
I create a datatable with 3 columns at run time and set it to a Datagrid. Datagrid has 5 extended columns. for example one is numeric column, other is a date time picker, other is button.
I aim to create as a form like EXCEL but with special columns.
I add a row to datatable after creating. I want to add others when the user fills all fields or press down key.
I couldnt achive yet, there is always problem, Could u advise another method to do that?
|
|
|
|
|
Hi Everybody!!
I am new to VB.Net and require your help on
How to Add nodes to a TreeView control from a file??
I have a file containing patterns(say Patterns.txt) and each pattern has to be a node in the TreeView
The patterns are like follows:
Pattern1 - DT;FG;HK;KH;AU;BL;JC
Pattern2 - DT;GH;AU;JH;KG;JC
So, Pattern1 will be a node in the Tree and the Tags separated by semi colons will be its children. Similarly other patterns will be populated.
Please provide me with any hint or solution.
Thank you
Bye
Enjoy!!
AyBee
|
|
|
|
|
What do you have trouble with, reading the file, or adding child nodes ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi !!
The problem has been sorted out. It was rather simple than I thought it would be as VB has already provided the necessary procedures for adding nodes and I opened the file using the File System Object.
Any further suggestions are welcome.
Thank you
Bye
ENJOY !!
AyBee
|
|
|
|
|
.... Have read about it but can't figure out the issue!
Declare WebFunction as "Save(MyNums as Array)"
Client sees MyNums as Object ... Tried a few converts.. The data in array/arraylist is just strings.
How is it done?
//Maw
|
|
|
|
|
I thought web services only spoke XML ? So then a document that contains the string list would be the thing.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Soooo .... then how is it done? I have data in an array-list that I want to pass though a WebService and I want the webservice to convert data to array-list and go through it and do some magic with its data. Data is always strings.
//Maw
|
|
|
|