My Struggle - VB6 to VB.NET

Page 1 of 1

1 Replies - 501 Views - Last Post: 03 July 2012 - 09:45 AM Rate Topic: -----

#1 UdiHrant  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 10-November 08

My Struggle - VB6 to VB.NET

Posted 03 July 2012 - 09:22 AM

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...

Public Class Form1

    Private Sub MIS_JOBSBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MIS_JOBSBindingNavigatorSaveItem.Click
        Me.Validate()
        Me.MIS_JOBSBindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me.IntraWebDataSet)

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'IntraWebDataSet.MIS_JOBS' table. You can move, or remove it, as needed.
        Me.MIS_JOBSTableAdapter.Fill(Me.IntraWebDataSet.MIS_JOBS)

    End Sub

    Private Sub BtnQUIT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnQUIT.Click
        End
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnACTION.Click
        Me.MIS_JOBSBindingSource.MoveLast()
        '  Label1.Text = Me.MIS_JOBSBindingSource.Item.field("gender")
    End Sub

    Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click

    End Sub
End Class


ANY help will be appreciated!

Is This A Good Question/Topic? 0
  • +

Replies To: My Struggle - VB6 to VB.NET

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9583
  • View blog
  • Posts: 36,319
  • Joined: 12-June 08

Re: My Struggle - VB6 to VB.NET

Posted 03 July 2012 - 09:45 AM

Please do not create duplicate topics.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1