|
nah i didnt write it, but ive got the source which has been compiled under debug
still not sure how you would step into it and how you would go about setting breakpoints etc from the new project...
|
|
|
|
|
You may need to put the dll project into yuor solution, but I don't think so. If yo uset a break point at a call to the dll, I think F11 will step in. If you want breakpoints within the dll, yes, you will need to make the project part of the solution.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
thanks christian for your help.. have stepped into the c# code from adding it to the solution.
many thanks.
now the fun begins...
|
|
|
|
|
Im using vs 2005 to design a database driven program. I went through a video tutorial and designed a database example that worked fine, so i used the exact same structure to design my own.
I have a list box that recieves the list of Groups(Its for a field trip schedule), then each control on the form, the list box, text boxes for group member names etc. is databound to a binding source, this binding source is in turn, bound to the instance of my dataset.
In the tutorial we used this code to save the data:
Me.BindingSource1.EndEdit(me.MyCompanyDataSet1.Customer)
Me.CustomerTableAdapter1.Update(Me.MyCompanyDataSet1.Customer)
and it worked fine, i have added this code, but changed the names to my own:
Me.GroupsBindingSource.EndEdit()
Me.GroupsTableAdapter1.Update(Me.GroupsDataSet1.Groups)
but it still doesn't work. When I load the form i fill the instance of the table adapter that's on my form via:
Me.GroupsTableAdapter1.Fill(Me.GroupsDataSet1.Groups)
Which in turn fills my Listbox and controls. When I change something in runtime, eg Group Name, the change shows on my onscreen data, but when i close and reopen the data its all back to the default and nothing has been permanently saved.
Thanks in advance for your help.
Posted by The ANZAC
|
|
|
|
|
Using the auto generated stuff, you give up a lot of control over your database. However, I notice one change :
Me.BindingSource1.EndEdit(me.MyCompanyDataSet1.Customer)
Me.GroupsBindingSource.EndEdit()
You're not passing in a dataset anymore. Should you be ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
nah, somehow i managed to bind one binding source to another which was bound to a dataset, i fixed this issue. However, I run the program, change some values then save and i can actually see the values change, but when i stop running the program and run it again after some time, all my values are returned to defualt values that i first entered in my table.
Is this a normal thing, do i have to publish export and run my program before i see these changes. Or should they stay changed even after running and closing.
Posted by The ANZAC
|
|
|
|
|
Then your changes were not written/commited to the table. There's still something wrong with your code.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Well I can't figure out what it is. I was wondering if you were able to outline the general structure needed to create an editable( e.g. New, Edit, Remove) database interface. Especially, I was wondering if you could outline exactly the normal code to save/update changes a database that is accessed through:
Binding Source Bound to DataSet bound to database.
Posted by The ANZAC
|
|
|
|
|
If you're using the wizards to create all the objects, I really can't direct you. The wizards generate code all over the place that's difficult to locate, let alone support.
But basically, once the user wants to save changes back to the database, you do something like this:
' For VB.NET 2005
DataAdapter1.AcceptChangesDuringUpdate = True
DataAdapter1.Update(DataSet1)
' For VB.NET 2002 and 2003
DataAdapter1.Update(DataSet1)
DataSet1.AcceptChanges()
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hi
i am little new to VB.net windows application
i am using treeview which shows the hierarchy and next to it is a datagrid generally like our windows explorer.
the thing is that i want to display a list of all the parent node that i select with the depth level. where the tree is generated at the runtime from the database.
i am littlebit clueless please help to rectify it
Praveen Kumar
|
|
|
|
|
I'm not seeing what your trying to describe. You mean you want to show a list of the parent nodes for each child node you click on?? Something like:
Parent1
Parent2
Parent3
ClickedChildNode
Every TreeNode object, whether it's a Parent and/or Child, has a Parent property that returns the parent node of the current node. For example, above, if you clicked on ClickedChildNode, it's Parent property would return the Parent3 treenode. All you have to do is keep getting the parent of each parent node until Parent returns Nothing, meaning your at the top of the tree.
TreeNode.Parent[^] property docs.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi, I need some help with the FOR EACH command, here is my code:
Dim b As New ToolStripMenuItem
For Each b In Me.cmsTestList.Items
Debug.Print(b.Name)
Debug.Print(b.Tag)
If b.CheckOnClick = True Then
If b.Tag = "check" Then
b.Checked = True
Else
b.Checked = False
End If
End If
Next
cmsTestList is of the type Windows.Forms.ContextMenuStrip
and
cmsTestList.Items returns a Windows.Forms.ToolStripItemCollection
I was under the impression that the object "b" will always be of the type: ToolStripMenuItem since I specified explicitly FOR EACH ToolStripMenuItem.
But the code tries looping through other items in my menu such as 'System.Windows.Forms.ToolStripTextBox'. This is not a ToolStripMenuItem as far as I know!
So resultingly the code breaks with the error:
Unable to cast object of type 'System.Windows.Forms.ToolStripTextBox' to type 'System.Windows.Forms.ToolStripMenuItem'.
I would never have thought that type casting will be necessary for this kind of implementation of the FOR EACH x IN command , and I don't know how to deal with this type casting either.
What I need to do is to loop through only the ToolStripMenuItems and not through all the other ToolStripItems as well!
Any ideas?
Kind Regards
you can't forget something you never knew...
"Watching Migthy Joe Young made me hate my life..................................I want a gorilla!" A. Havemann
|
|
|
|
|
It doesn't work the way you are thinking. The for each does not limit the type of controls in the collection. You need to do something like the following:
<br />
for each item as ToolStripItem in cmsTestList.Items<br />
if item.Type is GetType(ToolStripMenuItem) then<br />
'do your work here<br />
end if<br />
next<br />
Mike Lasseter
|
|
|
|
|
i'm using VB6
im about to finish my proj
it must play both of MP3 and WAV files
i need to play mp3 file from my proj without any control
just play it
thanx alot
|
|
|
|
|
You need to use the Windows Media Player control, and you can set it to not display anything.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
hi...
i am trying to create a vertical tab control in vb.net but could not manage to keep the alignment horizontal. What i want is that the tab should come in vertical but should be placed horizontally as in the startup property page of a project in vb.net.
anyone could please help me.
thanks
|
|
|
|
|
I want to make my form NEVER_Minimizable
to do that.....i;ve done this:--
Protected Overloads Overrides Sub WndProc(ByRef msg As Message)
If msg.Msg = WM_SYSCOMMAND Then
If msg.WParam.ToInt32 = SC_MINIMIZE Then
Else
MyBase.WndProc(msg)
End If
BUT, This never handles Windows + D (Show Desktop) keys..
How to handle that ??
"You can do any thing you set to your mind" - theGhost_k8
|
|
|
|
|
Try removing the control box/minimize button/form border to make it impossible for the user to minimize.
|
|
|
|
|
Here aint a NewBie stuff.....
I've said cancel d effect of Ctrl + M / Ctrl + D
"You can do any thing you set to your mind" - theGhost_k8
|
|
|
|
|
vb.net
when i set alignment of a datagrid's columnheader to right, then the headertext's last letter on the right is halfway hidden. how can i avoid that?
|
|
|
|
|
Increase the column width.
|
|
|
|
|
it's not depending from the column header's width. the last letter is cut anyway.
|
|
|
|
|
Hello,
I'm trying to populate my ID and Dealername in my combobox, but when I try the below scripts, I'm only seeing the ID at runtime... How can I show both the ID and DealerName in my combobox?
<br />
Me.cboSelectDealer.DataSource = ReportDS.Tables("tblCall_Reports")<br />
Me.cboSelectDealer.DisplayMember = "UID" & "-" & " DealerName"<br />
Me.cboSelectDealer.ValueMember = "UID"<br />
<br />
Me.cboSelectDealer.DataSource = ReportDS.Tables("tblCall_Reports")<br />
Me.cboSelectDealer.DisplayMember = "UID" + "-" + " DealerName"<br />
Me.cboSelectDealer.ValueMember = "UID"<br />
Thanks in advance.
|
|
|
|
|
I realise this is an old post but it might help someone else out.
I needed to do a similar thing but I didn't want to concatinate fields in the sql used to fill the datatable as it was contained in an existing stored procedure. So I filled the datatable with the records I wanted then basically added another column in the datatable which was my concatinated display value. I then used this new column as the DisplayMember.
assuming we have a datatable which is populated with "AccountCode" and corresponding "AccountName"
eg "ABC" , "Freds workshop"
"XYZ" , "Bills Lighting"
'Add a new calculated column to the datatable
Dim DataCol As DataColumn = New DataColumn("Display")
DataCol.DataType = System.Type.GetType("System.String")
DataCol.Expression = "AccountCode + (' - ') + AccountName"
dt.Columns.Add(DataCol)
'Now setup the combobox
cmbAvailableCompanies.DataSource = dt
cmbAvailableCompanies.DisplayMember = "Display"
cmbAvailableCompanies.ValueMember = "AccountsCode"
It will now display "ABC - Freds Workshop" and "XYZ - Bills Lighting" in the combobox.
The only issue I have found is if I turn sorting of the combobox on the SelectedValue of the combobox gets out of sync with the Displayed value. I haven't worked this out yet but for the time being I can live with it.
|
|
|
|
|
Hi!
How do I allow the user to reload the main form of the application? In essence, I want a button that closes the whole program and opens it again, starting from scratch.
thanks
|
|
|
|