Click here to Skip to main content
15,919,245 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Calling .NET component from VB6. Pin
Dave Kreskowiak24-Mar-08 4:10
mveDave Kreskowiak24-Mar-08 4:10 
GeneralRe: Calling .NET component from VB6. Pin
SPanicker*24-Mar-08 4:38
SPanicker*24-Mar-08 4:38 
GeneralRe: Calling .NET component from VB6. Pin
Dave Kreskowiak26-Mar-08 13:23
mveDave Kreskowiak26-Mar-08 13:23 
GeneralPopup Message Box in Windows Service Pin
vijay_8323-Mar-08 20:15
vijay_8323-Mar-08 20:15 
GeneralRe: Popup Message Box in Windows Service Pin
Dave Kreskowiak24-Mar-08 4:07
mveDave Kreskowiak24-Mar-08 4:07 
QuestionAssemble captured image packets and display Pin
Dan Worthington23-Mar-08 11:12
Dan Worthington23-Mar-08 11:12 
GeneralRe: Assemble captured image packets and display Pin
A Wong24-Mar-08 7:06
A Wong24-Mar-08 7:06 
Generalplease i need real help ( iam tiered from it) Pin
asha_s23-Mar-08 8:54
asha_s23-Mar-08 8:54 
i have 2 problem
the first is:

i am dealing withe database my connection is
Public ConStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _<br />
"Data Source =" & Application.StartupPath & "\ITDSS.mdb"<br />
    Public con As New OleDbConnection(ConStr)

i am deleting from it and it work smile.gif smile.gif

but after i close my project than i open it and i made run i found that the deleted record in the database ohmy.gifBlush | :O

after i delete i check only the database in the dubg file

how can i make it delete for ever

is the rong in the connection

the code is deleting and inserting will its runing after i close the project and rerun it agen in the database i found the deleted record
also i but the database in the debug fill but i found it in many folder insad my project fill

<br />
  Dim sql As String = "SELECT * FROM [Section]"<br />
        Dim sql2 As String = "SELECT * FROM Slot"<br />
        Dim da As New OleDbDataAdapter(sql, con)<br />
        Dim da2 As New OleDbDataAdapter(sql2, con)<br />
        Dim ds As New DataSet<br />
        Dim ds2 As New DataSet<br />
        da.Fill(ds, "Section")<br />
        da2.Fill(ds2, "Slot")<br />
        Dim InsertCommand1 As New OleDbCommand<br />
        Dim InsertCommand2 As New OleDbCommand<br />
        con.Open()<br />
        InsertCommand1.Parameters.Clear()<br />
        InsertCommand1.Connection = con<br />
        InsertCommand1.CommandText = "DELETE FROM [Section] WHERE SectionID=" & ComboBox105.Text<br />
        InsertCommand1.CommandType = CommandType.Text<br />
        InsertCommand1 = InsertCommand1<br />
        Me.BindingContext(ds, "Section").EndCurrentEdit()<br />
        da.Update(ds, "Section")<br />
        InsertCommand1.ExecuteNonQuery()<br />
<br />
        'to delet all the slot for the deleted section<br />
        InsertCommand2.Connection = con<br />
        InsertCommand2.CommandText = "DELETE  FROM  Slot WHERE SectionID=" & ComboBox105.Text<br />
        InsertCommand2.CommandType = CommandType.Text<br />
        InsertCommand2 = InsertCommand2<br />
        Me.BindingContext(ds2, "Slot").EndCurrentEdit()<br />
        da2.Update(ds2, "Slot")<br />
        InsertCommand2.ExecuteNonQuery()<br />
        con.Close()<br />

i delete from tow table


and this for insert


con.Open()<br />
        Dim sql As String = "SELECT * FROM [Section]"<br />
        Dim sql2 As String = "SELECT * FROM Slot"<br />
        Dim da As New OleDbDataAdapter(sql, con)<br />
        Dim da2 As New OleDbDataAdapter(sql2, con)<br />
        Dim ds As New DataSet<br />
        Dim ds2 As New DataSet<br />
        da.Fill(ds, "Section")<br />
        da2.Fill(ds2, "Slot")<br />
        Dim InsertCommand1 As New OleDbCommand<br />
        Dim InsertCommand2 As New OleDbCommand<br />
<br />
<br />
        '---insrting section to section databace<br />
        InsertCommand1.Parameters.Clear()<br />
        InsertCommand1.Connection = con<br />
        InsertCommand1.CommandText = "INSERT INTO [Section] ([SectionID],[CourseID],[Type],[TeacherID],[joinedSection],[Group],[Capacity]) VALUES (?,?,?,?,?,?,?)"<br />
        InsertCommand1.CommandType = CommandType.Text<br />
        InsertCommand1 = InsertCommand1<br />
        Try<br />
            InsertCommand1.Parameters.AddWithValue("?", Trim(CType(TextBox46.Text, Integer)))<br />
            InsertCommand1.Parameters.AddWithValue("?", Trim(ComboBox99.Text))<br />
            InsertCommand1.Parameters.AddWithValue("?", Trim(ComboBox102.Text))<br />
            InsertCommand1.Parameters.AddWithValue("?", Trim(0))<br />
            InsertCommand1.Parameters.AddWithValue("?", Trim(0))<br />
            InsertCommand1.Parameters.AddWithValue("?", Trim(TextBox47.Text))<br />
            InsertCommand1.Parameters.AddWithValue("?", Trim(0))<br />
            da.InsertCommand = InsertCommand1<br />
            InsertCommand1.ExecuteNonQuery()<br />
        Catch ex As Exception<br />
            MsgBox(ex, , "Alert")<br />
        End Try<br />
        Me.BindingContext(ds, "Section").EndCurrentEdit()<br />
        da.Update(ds, "Section")





sorry about that but also i whant to ask about
can i update using this statment
sectionsforupdate.Tables("Slot").Rows(i).Item(0) = slot<br />
sectionsforupdate.AcceptChanges()<br />

GeneralRe: please i need real help ( iam tiered from it) Pin
Christian Graus23-Mar-08 11:27
protectorChristian Graus23-Mar-08 11:27 
GeneralRe: please i need real help ( iam tiered from it) Pin
asha_s24-Mar-08 0:09
asha_s24-Mar-08 0:09 
GeneralRe: please i need real help ( iam tiered from it) Pin
Dave Kreskowiak24-Mar-08 4:05
mveDave Kreskowiak24-Mar-08 4:05 
GeneralRe: please i need real help ( iam tiered from it) Pin
asha_s24-Mar-08 7:40
asha_s24-Mar-08 7:40 
GeneralRe: please i need real help ( iam tiered from it) Pin
Dave Kreskowiak26-Mar-08 6:47
mveDave Kreskowiak26-Mar-08 6:47 
GeneralRe: please i need real help ( iam tiered from it) Pin
asha_s26-Mar-08 7:18
asha_s26-Mar-08 7:18 
GeneralRe: please i need real help ( iam tiered from it) Pin
Dave Kreskowiak26-Mar-08 7:20
mveDave Kreskowiak26-Mar-08 7:20 
GeneralHelp on a program Pin
antlex23-Mar-08 6:26
antlex23-Mar-08 6:26 
GeneralRe: Help on a program Pin
pmarfleet23-Mar-08 7:11
pmarfleet23-Mar-08 7:11 
GeneralRe: Help on a program Pin
Christian Graus23-Mar-08 11:36
protectorChristian Graus23-Mar-08 11:36 
Questioninserting data in to ms access database Pin
bapu288923-Mar-08 4:38
bapu288923-Mar-08 4:38 
GeneralRe: inserting data in to ms access database Pin
pmarfleet23-Mar-08 5:26
pmarfleet23-Mar-08 5:26 
GeneralRe: inserting data in to ms access database Pin
Paul Conrad23-Mar-08 5:35
professionalPaul Conrad23-Mar-08 5:35 
GeneralRe: inserting data in to ms access database Pin
pmarfleet23-Mar-08 5:51
pmarfleet23-Mar-08 5:51 
QuestionRe: inserting data in to ms access database Pin
bapu288923-Mar-08 6:00
bapu288923-Mar-08 6:00 
GeneralRe: inserting data in to ms access database Pin
Dave Kreskowiak23-Mar-08 15:38
mveDave Kreskowiak23-Mar-08 15:38 
GeneralHosting controls on a layered window Pin
Soumik Chatterjee23-Mar-08 4:02
Soumik Chatterjee23-Mar-08 4:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.