Wrox Programmer Forums
|
Pro VB.NET 2002/2003 For advanced Visual Basic coders working .NET version 2002/2003. Beginning-level questions will be redirected to other forums, including Beginning VB.NET.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 15th, 2003, 01:43 AM
Registered User
 
Join Date: Aug 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Add & delete in vb.net

hello.In my projet, i have to enter new teachers and their information to my database.The form used for this action containd checkBox & radio bottum.I wrote a code but it dosn't working.All i wan't to do, is to add row to table & delete Row from Table.Thats mean Add or delete a teacher from my database.

My code:

Dim Nom, Prenom, CapitalInitial As String
        Nom = txtnom.Text
        Prenom = txtprenom.Text
        CapitalInitial = StrConv(Nom, VbStrConv.ProperCase)
        CapitalInitial = StrConv(Prenom, VbStrConv.ProperCase)

        Dim NewRow As DataSet1.ProffesseurRow
        NewRow = DataSet11.Proffesseur.NewProffesseurRow
        NewRow.Item("NomProff") = txtnom.Text
        NewRow.Item("PrenomProff") = txtprenom.Text
        If Vacbtm.Checked Then
            NewRow.Item("Etat") = Vacbtm.Text
        Else
            NewRow.Item("Etat") = Perbtm.Text
        End If

        If IGbx.Checked Then
            NewRow.Item("Options") = " & IGbx.Text"
        ElseIf GEAbx.Checked Then
            NewRow.Item("Options") = " & GEAbx.Text"
        ElseIf ACOBAbx.Checked Then
            NewRow.Item("Options") = " & ACOBAbx.Text"
        ElseIf Ibx.Checked Then
            NewRow.Item("Options") = " & Ibx.Text"
        ElseIf IMbx.Checked Then
            NewRow.Item("Options") = " & IMbx.Text"
        End If
        NewRow.Item("CodeProff") = 0
        DataSet11.Proffesseur.AddProffesseurRow(NewRow)
        Me.BindingContext(DataSet11, "Proffesseur").ResumeBinding()


Thank you

myriam
 
Old August 17th, 2003, 07:49 PM
Authorized User
 
Join Date: Jun 2003
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to planeswalk
Default

Hi,

If you are using a SQL database, then you can use the SqlCommand class under the System.Data.SqlClient namespace for the job. Here's a link where you can read more about it:

http://www.aspalliance.com/aspxtreme...mandClass.aspx

Cheers!


Marlon Villarama
Support Team
Web Burner Hosting
[email protected]
www.webburner.com
Toll-Free: 877-535-2876





Similar Threads
Thread Thread Starter Forum Replies Last Post
autocomplete dropdownlistASP.NET 2.0 & VB.NET 2005 alexdcosta ASP.NET 2.0 Professional 10 May 11th, 2009 02:21 AM
VB .NET COM Add-in on Outlook 2000 kydm VB.NET 3 June 9th, 2005 12:57 PM
Create/delete Exchange 5.5 Mailbox with VB.Net DennisTh VB How-To 7 August 5th, 2004 08:52 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.