I'm really trying guys - honestly. But the books I have are either too simple and only use controls or go into squirrly code snippets that are damn hard to follow. ANY HELP WILL BE APPRECIATED HERE...
Two basic questions first :
1 - all the books I have say that the way to start working with VB.NET and SQL is to build a data bound item by dragging my data source onto an empty form. That will create a default datagrid object with the right code behind it. Ok - yes - that works fine. But what if I don't want to have a datagrid control showing on my form. I make it visible=false but the navigation controls still appear at the top of my form!
2 - More importantly though, the VB6 programs I need to rewrite all involve manipulating strings and modifying exiting rows in a sql database. That was easy in VB6 using the fields property like this -
DataEnvironment3.rsIU_Biograph.Fields("Gender") = "M"
For the life of me I cannot find the equivelent of this statement in VB.NET
Here is some code that I tried but I can't figure out the right syntax for the remmed out statement at line 26...
I think I can get or replace a 'field' from my sql database through a property on the binding source but I can't figure out the syntax!
01 Public Class Form1
02
03 Private Sub MIS_JOBSBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MIS_JOBSBindingNavigatorSaveItem.Click
04 Me.Validate()
05 Me.MIS_JOBSBindingSource.EndEdit()
06 Me.TableAdapterManager.UpdateAll(Me.IntraWebDataSe t)
07
08 End Sub
09
10 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
11 'TODO: This line of code loads data into the 'IntraWebDataSet.MIS_JOBS' table. You can move, or remove it, as needed.
12 Me.MIS_JOBSTableAdapter.Fill(Me.IntraWebDataSet.MI S_JOBS)
13
14 End Sub
15
16 Private Sub BtnQUIT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnQUIT.Click
17 End
18 End Sub
19
20 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnACTION.Click
21 Me.MIS_JOBSBindingSource.MoveLast()
22 ' Label1.Text = Me.MIS_JOBSBindingSource.Item.field("description")
23 End Sub
24
25 Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
26
27 End Sub
28 End Class
ANY help will be appreciated!


LinkBack URL
About LinkBacks




Reply With Quote


Bookmarks