Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4335012
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:36:42+00:00 2026-05-21T10:36:42+00:00

I am new to vb.net and I am trying to update mysql table from

  • 0

I am new to vb.net and I am trying to update mysql table from a txt file using vb.net. So far I’ve found code here and there and been able to extract the data from the txt file, now my question is how to update mysql from the same dataset or xml file. Here is my code to populate the datagrid/dataset/xml file. Can you tell me what is the easiest way to update mysql assuming “Orden” is my primary key in mysql.

     OpenFileDialog1.Filter = "Text File|*.txt"
    OpenFileDialog1.Title = "Open File..."
    OpenFileDialog1.FileName = "trackings"

    If OpenFileDialog1.ShowDialog() = DialogResult.OK Then

        Dim DT As New DataTable
        DT.Columns.Add("COD")
        DT.Columns.Add("Tracking")
        DT.Columns.Add("Fecha")
        DT.Columns.Add("Orden")
        DT.Columns.Add("Estatus")


        Dim Lines() As String = System.IO.File.ReadAllLines(OpenFileDialog1.FileName)

        For Each Line As String In Lines
            Dim ItemsOf() As String = Split(Line, " ")
            ItemsOf = Line.Split(New String() {" "}, StringSplitOptions.RemoveEmptyEntries)
            If ItemsOf(0) = "N" Then ItemsOf(4) = 3 Else ItemsOf(4) = 6
            Dim NRow As String() = {ItemsOf(0), ItemsOf(1), ItemsOf(2), ItemsOf(3), ItemsOf(4)}
            DT.Rows.Add(NRow)
        Next Line
        DataGridView1.DataSource = DT
        Dim ds As New DataSet
        ds.Tables.Add(DT)
        ds.WriteXml("c:\x.xml")
    End If

Any help is appreciated! And with some code even more! =0)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T10:36:42+00:00Added an answer on May 21, 2026 at 10:36 am

    Based on your code, it looks like your flat file isn’t formatted in a complicated manner. If this is the case, you can skip generating the XML file altogether. Load the file directly onto MySQL using “LOAD DATA INFILE“.

    If necessary, load onto a staging table first, and then perform the update using that table.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying update my table from c# ado.net with this function.I am using
I am trying to update a set of queries using .NET's DataAdapter. Here's a
I'm trying to update global javascript variables from ASP.NET code. What I've tried to
I am using ADO.NET and trying to update a column value in a table
I'm trying to start a new ASP.NET Web Application Project using Visual Studio 2008.
I am new to ASP.NET and am trying to convert a web application from
I am new to ASP.net's MVC 3 (using VB) and I am trying to
I am using asp.net membership and trying to update a users details but get
I'm trying to grab some JSON data from a web service using JSON.Net. The
I'm trying to add records from a CSV file into a dataTable in vb.net,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.