|
I'm not ASP.NET expert, but one problem I see is that you're not casting the return value back to a dataset.
ds = CType(cache("Key"), DataSet)
Other than that, you'd probably have to ask this question in the ASP.NET Forum.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Is there a way to make teh ComboBox field appear empty?
I have a Windows form with a ComboBox in the first row and a DataGrid and some other controls in sync with the DataGrid. The first user action is to choose an item in the ComboBox. Then I use the SelectedValueChanged event to fill the form controls with data related to the item the user choose.
It works the way I wanted it, but there is one thing that bothers me and I so far I was unable to find a solution:
When the user first opens the form, the first item in the Combo is already choosen by default and ComboBox field is filled with text. I would like that field to appear empty until the user explicitely chooses an item.
In VB6 it was easy: on Form_Load, I set the ListIndex property to -1 for an ordinary ComboBox, or the BoundText property to '', for a Data Combo.
But, in VB. NET, setting the SelectedIndex property to -1 or any other non existing value is ignored and the ComboBox defaults to the first item (SelectedIndex = 0). (Bug or feature?)
It is confusing, because when the form is first open, the Combo field is filled, but all the other controls are empty. If the user wants to see data related to the first Combo item, she has to click the Combo and chose the item that appears already choosen which seems rather illogical.
Thank you in advance for any hints.
Best regards.
|
|
|
|
|
Mashinovodja wrote: Is there a way to make teh ComboBox field appear empty?
If ComboBox.DropDownStyle = DropDown , then setting SelectedIndex to -1 won't clear the selection. Instead, you clear it like this...
ComboBox.Text = String.Empty
|
|
|
|
|
No, it does not work: no matter what DropDownStyle I choose for the Combo, when I first open the form, I always get displayed the first line of the DataTable. I use this code:
With reasonCombo
.DisplayMember = "Description"
.ValueMember = "ReasonID"
.DataSource = ds2.Tables("Reasons").DefaultView
.Text = String.Empty
End With
I initialize tho Combo Box the Form_Load event
Thank you for trying to help me.
Best regards
|
|
|
|
|
Awww... now I see. It's because you're using ComboBox.DataSource.
You see, once you set ComboBox.DataSource, you can only select strings that exist in that DataSource. Now if an empty string existed in your DataSource, well then it would work.
Another solution would be to not set ComboBox.DataSource. Then add items to the ComboBox yourself via ComboBox.Items.Add(). That way you can set ComboBox.Text to anything that you want.
-- modified at 13:07 Friday 17th February, 2006
|
|
|
|
|
What is manifest file. What is the need of this file?
|
|
|
|
|
In a setup program is a summary of the files thatr are included in the whole installation.
Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
thanks for this!!! I want to know in what situation we have to use manifest file?
Any query related to VB.NET+Network Programming
email: sharma.hariomprakash@gmail.com
|
|
|
|
|
Perhaps you should read marcdev's answer instead of just asking the same question all over again?
---
b { font-weight: normal; }
|
|
|
|
|
hello again
can you please help me again about this datagridview coz i'm not so familiar about this control....my question is ...if i'm going to add new record from the datagridview how can i clear again the datagridview to able for me to add again new record without deleting the current record...looks like this...first i'm going add record in the datagrid so its already there then second i want to add new record agin but i want the datagridview to cleared before the second record in.. without deleting the current record...how can i do that...can you help please...
thanks in advance
|
|
|
|
|
hi
i have a problem of populating the datagridview which is unbound data coming from the other form....look like this...i well explain...i used two forms one form who holds the datagridview and the second forms holds the textboxes which i'm going to input my data and well putted into the others form which has the datagrid...i'm stock in this case...i'm not using binding,,all i want to know is..how do i get the data from the other form...
can you please help to formulate the code for unbound...please guys...
thanks
|
|
|
|
|
|
Hi... Right now I'm using visual basic in access so the controls are limited. there is no timer included in the controls that i'm using. i need to stop a process when i press escape key... so i used doevents and on_keypress. But the problem is while the process is running you can press the buttons in the form... the quit button etc. including the process button. if i disable the process button after i pressed it there would be an error and it will not continue the process. is there a way that i can disable the mouse event? tnx
|
|
|
|
|
Access is a funny animal... IIRC, you cannot disable a button that has the input focus. You have to give another control the focus before you can set your button's Enabled property to False.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
help me...
I want change properties of file as summary tab (title,subject,author)
by use vb.net
kbbman2
|
|
|
|
|
It's most definately NOT easy! Here[^] is a sample of the code you need to pull this off. There is no native support for this in the .NET Framework BCL.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I'm using the following code to update my database but the changes in my data table never reflected back to my database
<br />
<br />
Dim aDataTable as new aDataSet.MyTable<br />
Dim aTableAdapter as new aDataSetTableAdapters.MyTableTableAdapter<br />
<br />
aTableAdapter.Fill ( aDataTable )<br />
<br />
Dim aRow as DataRow<br />
<br />
aRow = aDataTable.NewRow()<br />
aRow.item(0) = "Test 123"<br />
<br />
aDataTable.Rows.Add ( aRow )<br />
<br />
aDataTable.AcceptChanges()<br />
aTableAdapter.Update( aDataTable )<br />
<br />
What have I miss ?
Thank you
WiL
|
|
|
|
|
You're calling the .AcceptChanges() method to commit the changes to the DataSet, not the database. Call the DataAdpter 's .Update() method BEFORE you call AcceptChanges
Update commits any changes back to the database.
AcceptChanges commits any changes to the DataTable and resets each DataRow's status to Unchanged . This is why no changes are being written back to the database. Because you've told the table there are no changes!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
You're the best!
Thanks alot
WiL
|
|
|
|
|
is there another way of comparing duplicate picture (jpg)
aside from filename, filesize and dates
tnx in advance
|
|
|
|
|
You could try doing a SHA1 hash on it. There's C++ code that does it on CP but I'm not sure about VB/VB.NET.
Steve
|
|
|
|
|
Could someone please explain to me the easiest way in code to compare two files?
I have created an openfiledialog to select 2 files and would like to compare them. I looked at msn but got very confused. If you don't mind taking the time to show me an example that would be wonderful.
Thanks again.
Win32newb
"If I wrote a book like I code. It would be one page thick and contain only one word (DUH!)"
|
|
|
|
|
|
hello everyone!! I am a student from India. I need the source code for implemention of sobel and canny edge detection for tumour image analysis.If anyone knows where I can get it or has the source code please please notify.
signing off is preci
|
|
|
|
|