Menu
Home
Forums
New posts
Search forums
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
C# Community
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Home
Forums
VB.NET
VB.NET General Discussion
My Struggle - VB6 to VB.NET
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="UdiHrant" data-source="post: 147978" data-attributes="member: 40235"><p>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...</p><p></p><p>Two basic questions first :</p><p></p><p>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!</p><p></p><p>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 -</p><p></p><p>DataEnvironment3.rsIU_Biograph.Fields("Gender") = "M"</p><p></p><p>For the life of me I cannot find the equivelent of this statement in VB.NET </p><p></p><p>Here is some code that I tried but I can't figure out the right syntax for the remmed out statement at line 26...</p><p></p><p>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!</p><p></p><p></p><table style='width: 100%'><tr><td>01</td><td>Public Class Form1 </td></tr></table><p></p><table style='width: 100%'><tr><td>02</td><td> </td></tr></table><p></p><table style='width: 100%'><tr><td>03</td><td> Private Sub MIS_JOBSBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MIS_JOBSBindingNavigatorSaveItem.Click </td></tr></table><p></p><table style='width: 100%'><tr><td>04</td><td> Me.Validate() </td></tr></table><p></p><table style='width: 100%'><tr><td>05</td><td> Me.MIS_JOBSBindingSource.EndEdit() </td></tr></table><p></p><table style='width: 100%'><tr><td>06</td><td> Me.TableAdapterManager.UpdateAll(Me.IntraWebDataSet) </td></tr></table><p></p><table style='width: 100%'><tr><td>07</td><td> </td></tr></table><p></p><table style='width: 100%'><tr><td>08</td><td> End Sub</td></tr></table><p></p><table style='width: 100%'><tr><td>09</td><td> </td></tr></table><p></p><table style='width: 100%'><tr><td>10</td><td> Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load </td></tr></table><p></p><table style='width: 100%'><tr><td>11</td><td> 'TODO: This line of code loads data into the 'IntraWebDataSet.MIS_JOBS' table. You can move, or remove it, as needed. </td></tr></table><p></p><table style='width: 100%'><tr><td>12</td><td> Me.MIS_JOBSTableAdapter.Fill(Me.IntraWebDataSet.MIS_JOBS) </td></tr></table><p></p><table style='width: 100%'><tr><td>13</td><td> </td></tr></table><p></p><table style='width: 100%'><tr><td>14</td><td> End Sub</td></tr></table><p></p><table style='width: 100%'><tr><td>15</td><td> </td></tr></table><p></p><table style='width: 100%'><tr><td>16</td><td> Private Sub BtnQUIT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnQUIT.Click </td></tr></table><p></p><table style='width: 100%'><tr><td>17</td><td> End</td></tr></table><p></p><table style='width: 100%'><tr><td>18</td><td> End Sub</td></tr></table><p></p><table style='width: 100%'><tr><td>19</td><td> </td></tr></table><p></p><table style='width: 100%'><tr><td>20</td><td> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnACTION.Click </td></tr></table><p></p><table style='width: 100%'><tr><td>21</td><td> Me.MIS_JOBSBindingSource.MoveLast() </td></tr></table><p></p><table style='width: 100%'><tr><td>22</td><td> ' Label1.Text = Me.MIS_JOBSBindingSource.Item.field("description") </td></tr></table><p></p><table style='width: 100%'><tr><td>23</td><td> End Sub</td></tr></table><p></p><table style='width: 100%'><tr><td>24</td><td> </td></tr></table><p></p><table style='width: 100%'><tr><td>25</td><td> Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click </td></tr></table><p></p><table style='width: 100%'><tr><td>26</td><td> </td></tr></table><p></p><table style='width: 100%'><tr><td>27</td><td> End Sub</td></tr></table><p></p><table style='width: 100%'><tr><td>28</td><td>End Class</td></tr></table><p></p><p></p><p></p><p></p><p></p><p>ANY help will be appreciated!</p></blockquote><p></p>
[QUOTE="UdiHrant, post: 147978, member: 40235"] 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! [TABLE] [TR] [TD="class: number"]01[/TD] [TD="class: content"]Public Class Form1 [/TD] [/TR] [/TABLE] [TABLE] [TR] [TD="class: number"]02[/TD] [TD="class: content"] [/TD] [/TR] [/TABLE] [TABLE] [TR] [TD="class: number"]03[/TD] [TD="class: content"] Private Sub MIS_JOBSBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MIS_JOBSBindingNavigatorSaveItem.Click [/TD] [/TR] [/TABLE] [TABLE] [TR] [TD="class: number"]04[/TD] [TD="class: content"] Me.Validate() [/TD] [/TR] [/TABLE] [TABLE] [TR] [TD="class: number"]05[/TD] [TD="class: content"] Me.MIS_JOBSBindingSource.EndEdit() [/TD] [/TR] [/TABLE] [TABLE] [TR] [TD="class: number"]06[/TD] [TD="class: content"] Me.TableAdapterManager.UpdateAll(Me.IntraWebDataSet) [/TD] [/TR] [/TABLE] [TABLE] [TR] [TD="class: number"]07[/TD] [TD="class: content"] [/TD] [/TR] [/TABLE] [TABLE] [TR] [TD="class: number"]08[/TD] [TD="class: content"] End Sub[/TD] [/TR] [/TABLE] [TABLE] [TR] [TD="class: number"]09[/TD] [TD="class: content"] [/TD] [/TR] [/TABLE] [TABLE] [TR] [TD="class: number"]10[/TD] [TD="class: content"] Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load [/TD] [/TR] [/TABLE] [TABLE] [TR] [TD="class: number"]11[/TD] [TD="class: content"] 'TODO: This line of code loads data into the 'IntraWebDataSet.MIS_JOBS' table. You can move, or remove it, as needed. [/TD] [/TR] [/TABLE] [TABLE] [TR] [TD="class: number"]12[/TD] [TD="class: content"] Me.MIS_JOBSTableAdapter.Fill(Me.IntraWebDataSet.MIS_JOBS) [/TD] [/TR] [/TABLE] [TABLE] [TR] [TD="class: number"]13[/TD] [TD="class: content"] [/TD] [/TR] [/TABLE] [TABLE] [TR] [TD="class: number"]14[/TD] [TD="class: content"] End Sub[/TD] [/TR] [/TABLE] [TABLE] [TR] [TD="class: number"]15[/TD] [TD="class: content"] [/TD] [/TR] [/TABLE] [TABLE] [TR] [TD="class: number"]16[/TD] [TD="class: content"] Private Sub BtnQUIT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnQUIT.Click [/TD] [/TR] [/TABLE] [TABLE] [TR] [TD="class: number"]17[/TD] [TD="class: content"] End[/TD] [/TR] [/TABLE] [TABLE] [TR] [TD="class: number"]18[/TD] [TD="class: content"] End Sub[/TD] [/TR] [/TABLE] [TABLE] [TR] [TD="class: number"]19[/TD] [TD="class: content"] [/TD] [/TR] [/TABLE] [TABLE] [TR] [TD="class: number"]20[/TD] [TD="class: content"] Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnACTION.Click [/TD] [/TR] [/TABLE] [TABLE] [TR] [TD="class: number"]21[/TD] [TD="class: content"] Me.MIS_JOBSBindingSource.MoveLast() [/TD] [/TR] [/TABLE] [TABLE] [TR] [TD="class: number"]22[/TD] [TD="class: content"] ' Label1.Text = Me.MIS_JOBSBindingSource.Item.field("description") [/TD] [/TR] [/TABLE] [TABLE] [TR] [TD="class: number"]23[/TD] [TD="class: content"] End Sub[/TD] [/TR] [/TABLE] [TABLE] [TR] [TD="class: number"]24[/TD] [TD="class: content"] [/TD] [/TR] [/TABLE] [TABLE] [TR] [TD="class: number"]25[/TD] [TD="class: content"] Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click [/TD] [/TR] [/TABLE] [TABLE] [TR] [TD="class: number"]26[/TD] [TD="class: content"] [/TD] [/TR] [/TABLE] [TABLE] [TR] [TD="class: number"]27[/TD] [TD="class: content"] End Sub[/TD] [/TR] [/TABLE] [TABLE] [TR] [TD="class: number"]28[/TD] [TD="class: content"]End Class[/TD] [/TR] [/TABLE] ANY help will be appreciated! [/QUOTE]
Insert quotes…
Verification
Post reply
Home
Forums
VB.NET
VB.NET General Discussion
My Struggle - VB6 to VB.NET
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top
Bottom