9 Replies - 1445 Views - Last Post: 19 March 2015 - 11:47 AM

#1 RustyAMcM  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 192
  • Joined: 21-January 15

Continuous updating gridview?

Posted 26 February 2015 - 02:45 PM

Is there a way to make a gridview continuously update looking for new files in a database such as I have a access 2010 database with a asp.net file with a gridview that pulls information from a table and sorts this information now what if I wanted to make sure that I always had the latest data in said web form lets say new files were being added as I was looking at the page can I have the page auto update the gridview? if so how is that done? also can the gridview or other view be made to show more detailed on a dropdown when you click on a cell in the table?

Is This A Good Question/Topic? 0
  • +

Replies To: Continuous updating gridview?

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 13561
  • View blog
  • Posts: 54,110
  • Joined: 12-June 08

Re: Continuous updating gridview?

Posted 26 February 2015 - 02:55 PM

Quote

if so how is that done?

Timer's are pretty nice about kicking off reoccurring events.

Quote

also can the gridview or other view be made to show more detailed on a dropdown when you click on a cell in the table?

For the most part you can program what ever you want. If you want more information then sure.. You can get more information.
Was This Post Helpful? 0
  • +
  • -

#3 RustyAMcM  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 192
  • Joined: 21-January 15

Re: Continuous updating gridview?

Posted 27 February 2015 - 06:11 AM

[quote name='modi123_1' date='26 February 2015 - 02:55 PM' timestamp='1424987710' post='2125364']

Quote

Timer's are pretty nice about kicking off reoccurring events.


That makes sense I use timers all the time in vb.net just did not know they were in asp as well.
also can the gridview or other view be made to show more detailed on a dropdown when you click on a cell in the table?

Quote

For the most part you can program what ever you want. If you want more information then sure.. You can get more information.


Got it here is my problem then... I am using visual studio pro 2013 when in design view I click on the gridview and I cannot add code for individual columns, Rows or Cells so to be able to do what I asked would I have to add the information to a regular table then add the code behind or can this still be done in grid view where if they click on a cell and it has say my name in it it would grow and show more details such as how many pieces per hour i made what my average rate is and so on ? could you please point my in the right direction for this any links would be greatly appreciated.

Thanks Again

This post has been edited by RustyAMcM: 27 February 2015 - 06:12 AM

Was This Post Helpful? 0
  • +
  • -

#4 Nakor  Icon User is offline

  • Professional Lurker
  • member icon

Reputation: 448
  • View blog
  • Posts: 1,504
  • Joined: 28-April 09

Re: Continuous updating gridview?

Posted 03 March 2015 - 06:13 AM

you're probably going to have to use a templatefield to create custom content within a gridview cell.

Using TemplateFields

My suggestion, and this is just my opinion, is to get away from using WebForms as soon as possible. It is great if you just need to drop a grid of data onto a screen but the minute you want to start doing anything custom it can get really complicated very quickly. Move on to MVC and learn to work with the html, javascript, and css directly rather than counting on a tool that obscures everything that a webpage is actually built with.
Was This Post Helpful? 1
  • +
  • -

#5 RustyAMcM  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 192
  • Joined: 21-January 15

Re: Continuous updating gridview?

Posted 04 March 2015 - 11:38 AM

MVC is an option I do have it installed as I am currently learning asp.net anyway so I could change over without many problems how would this be done in MVC do you know where i can get some examples?
Was This Post Helpful? 0
  • +
  • -

#6 RustyAMcM  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 192
  • Joined: 21-January 15

Re: Continuous updating gridview?

Posted 04 March 2015 - 11:44 AM

Ok I have got a timer installed to slow everything down and this also made the program run smother however I am now getting random cutoffs in my data-string how to I end a network stream like below on a carriage return?

networkStream = tcpClient.GetStream()

        Dim bytes(tcpClient.ReceiveBufferSize) As Byte

        networkStream.Read(bytes, 0, CInt(tcpClient.ReceiveBufferSize))

        '
        'Output the data received from the host to an Array
        '
        returndata = Encoding.ASCII.GetString(bytes)

        Dim x As Integer = 0
        For Each lne In returndata

            networkStream.Read(bytes, 0, CInt(tcpClient.ReceiveBufferSize))

            returndata = Encoding.ASCII.GetString(bytes)

            Dim MyDataArray() As String = Split(returndata, ",")


Thanks
Was This Post Helpful? 0
  • +
  • -

#7 RustyAMcM  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 192
  • Joined: 21-January 15

Re: Continuous updating gridview?

Posted 06 March 2015 - 08:21 AM

well I managed to get the random cutouts taken care of by added thread.sleep throughout the code to slow it down a little now I am having problems with the gridview not updating I have code that is triggered by the selection of a drop down box and I would like fire a gridview update at the end of this before it loops thru so that the gridview updates every cycle any ideas as to how to do this I have tried to add GridView.DataBind() but it is not fireing the update I also tried to attach code to update as follows but get an error that it needs to be IEnumerable, IDataBind and something else so please help I am running out of ideas fast.
con = New OleDb.OleDbConnection(MyDB)
                cmd = New OleDb.OleDbCommand(SQL, con)

                cmd.CommandText = "SELECT * FROM [AutoUpdateTableQuery] " 

                cmd.CommandTimeout = 20


                con.Open()


                
                Thread.Sleep(3000)
                GridView3.DataSource = cmd.ExecuteNonQuery
                Thread.Sleep(1000)
                GridView3.DataBind()

Was This Post Helpful? 0
  • +
  • -

#8 RustyAMcM  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 192
  • Joined: 21-January 15

Re: Continuous updating gridview?

Posted 09 March 2015 - 12:04 PM

Nakor,

Excellent and thank you for that information. I have been working on this all morning and have it working with the asp.net code below and the vb.net code below that.

I have just one question tho how can I limit this to just 2 places after the decimal point i tried to convert ToString("N2") and got nothing not even an error any ideas?

Added To first table:
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="SELECT DISTINCTROW  [Account_Data_Complete_Query.Operator] AS [Operator], Count([Account_Data_Complete_Query.Item]) AS [Item], Sum([Account_Data_Complete_Query.Worked]) AS [Worked], Sum([Account_Data_Complete_Query.Count]) AS [Count]  FROM [Account_Data_Complete_Query] WHERE (([Date] = ?))
GROUP BY [Account_Data_Complete_Query.Operator]" FilterExpression="[Operator]= '{0}' AND [Item]= '{1}'">
           <SelectParameters>
                <asp:ControlParameter ControlID="TextBox1" Name="Date" PropertyName="Text" Type="DateTime" DefaultValue="" />
               
           </SelectParameters>
            <UpdateParameters>
                <asp:Parameter Name="Operator" Type="String" />
                <asp:Parameter Name="Item" Type="String" />
                <asp:Parameter Name="Worked" Type="Int32" />
                <asp:Parameter Name="Count" Type="Int32" />
                <asp:Parameter Name="Pace" Type="Int32" />
             </UpdateParameters>
            <FilterParameters>


Added behind first table:
Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
        Try
            If e.Row.RowType = DataControlRowType.DataRow Then
                e.Row.Cells(5).Text = ((Convert.ToDecimal(e.Row.Cells(4).Text) / ((Convert.ToDecimal(e.Row.Cells(3).Text)) / 60)))
            End If

        Catch
        End Try
    End Sub


Added to second Table:
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConflictDetection="CompareAllValues" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" OldValuesParameterFormatString="original_{0} " ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="SELECT DISTINCTROW [Account_Data_Complete_Query.Operator] AS [Operator], [Account_Data_Complete_Query.Item] AS [Item],  Sum([Account_Data_Complete_Query.Worked]) AS [Worked], Sum([Account_Data_Complete_Query.Count]) AS [Count], [Account_Data_Complete_Query.Pace] AS [Pace] FROM  [Account_Data_Complete_Query] WHERE ( [Account_Data_Complete_Query.Operator] = ? AND [Account_Data_Complete_Query.Date] = ?)
GROUP BY   [Account_Data_Complete_Query.Operator], [Account_Data_Complete_Query.Item], [Account_Data_Complete_Query.Pace]" UpdateCommand="UPDATE [Account_Data_Complete_Query] SET [Operator] = @Operator, [Item] = @Item, [Worked] = @Worked, [Count] = @Count WHERE [Operator] = @origional_Operator AND [Item] = @origional_Item, AND [Worked] = @ origional_Worked, AND [Count] = @origional_Count">
            
            <SelectParameters>
                <asp:ControlParameter ControlID="GridView1" Name="Operator" PropertyName="SelectedValue" Type="String" />
                <asp:ControlParameter ControlID="TextBox1" Name="Date" PropertyName="Text" />
            </SelectParameters>
            <UpdateParameters>
                <asp:Parameter Name="Operator" Type="String" />
                <asp:Parameter Name="Item" Type="String" />
                <asp:Parameter Name="Worked" Type="Int32" />
                <asp:Parameter Name="Count" Type="Int32" />
                <asp:Parameter Name="PPM" Type="Int32" />
                <asp:Parameter Name="Pace" Type="Int32" />
                <asp:Parameter Name="% of Pace" Type="Int32" />
            </UpdateParameters>
            </asp:SqlDataSource>


Added Behind Second table:
Protected Sub GridView2_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView2.RowDataBound
        Try
            If e.Row.RowType = DataControlRowType.DataRow Then
                e.Row.Cells(4).Text = ((Convert.ToDecimal(e.Row.Cells(3).Text) / ((Convert.ToDecimal(e.Row.Cells(2).Text)) / 60)))
                Thread.Sleep(500)
                e.Row.Cells(6).Text = ((Convert.ToDecimal(e.Row.Cells(4).Text) / ((Convert.ToDecimal(e.Row.Cells(5).Text)))))
            End If
        Catch
        End Try
    End Sub

Was This Post Helpful? 0
  • +
  • -

#9 Nakor  Icon User is offline

  • Professional Lurker
  • member icon

Reputation: 448
  • View blog
  • Posts: 1,504
  • Joined: 28-April 09

Re: Continuous updating gridview?

Posted 14 March 2015 - 07:36 PM

if you are defining your columns in the gridview and not using automatic cell generation then you could do something like:

<asp:BoundField DataField="fieldName" HeaderText="Header Text"
                    SortExpression="fieldName" DataFormatString="{0:n2}" />


if you're using template fields:

<asp:TemplateField> 
    <ItemTemplate> <%#Eval("fieldName","{0:n}")%> </ItemTemplate> 
</asp:TemplateField>

This post has been edited by Nakor: 14 March 2015 - 07:37 PM

Was This Post Helpful? 1
  • +
  • -

#10 RustyAMcM  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 192
  • Joined: 21-January 15

Re: Continuous updating gridview?

Posted 19 March 2015 - 11:47 AM

I have a HTML Table that I want to add the values of a array into the array is MyDataArray and and the Table ID is LiveFeed.

not here is my question I already have working code that is pulling a live feed from a machine and putting it into a database how can i add the above functionality to the same web form? so that everytime it loops through it adds a row to the table then when i switch ip's the table clears and it starts all over...

Here is the current code
Imports System.Timers
Imports System.Net.IPAddress
Imports System.Net.Sockets
Imports System.Text
Imports System.Web.UI.UserControl
Imports System.Threading
Imports System.Data.OleDb
Imports System.Data
Partial Class Live_
    Inherits System.Web.UI.Page
    Private IPAddress As List(Of String)
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load



        IPAddress = New List(Of String)
        IPAddress.Add("192.168.0.1")
        IPAddress.Add("192.168.0.2")


        Dim dbConnector As New DatabaseConnector
        Dim MyDB As Object
        Dim tcpClient As New System.Net.Sockets.TcpClient
        Dim strConnection As String
        Dim returndata As String
        Dim networkStream As NetworkStream
        Dim Sql, SqlCode, SqlQuery, SQLAccount, SSQLCode As String
        Dim MyDate As Date
        Dim MyTime As Date
        Dim param1 As Object = Nothing
        Dim param8 As Object = Nothing
        Dim i As Integer = 1
        On Error Resume Next

Beginning:





        'Do a brief pause
        'Threading.Thread.Sleep(500)

        Dim x As Integer = 0
        For Each ip As String In IPAddress



            tcpClient = New System.Net.Sockets.TcpClient

            tcpClient.Connect(ip, 65000)

            networkStream = tcpClient.GetStream()

            Dim bytes(tcpClient.ReceiveBufferSize) As Byte

            networkStream.Read(bytes, 0, CInt(tcpClient.ReceiveBufferSize))

            returndata = Encoding.ASCII.GetString(bytes)
            Dim y As Integer = 0




            Dim ParseArray() As String = Split(returndata, vbCrLf)
            Dim n As Integer = ParseArray.Length - 1
            Dim m As Integer = 0
            Do While m < n

                Dim MyDataArray As String() = Split(ParseArray(m), ",")

                strConnection = _
                "Provider=Microsoft.ACE.OLEDB.12.0;" & _
                "Data Source=C:\inetpub\wwwroot\OperatorDataTestWeb.accdb;"

                MyDB = strConnection


                SqlQuery = _
                            "SELECT * FROM [AutoUpdateTable] " & _
                            "WHERE  [SerialNumb] = @SN AND [TimeStamp] = @TS"
                SSQLCode = _
                            "INSERT INTO [AutoUpdateTable] ([MachineID], [SerialNumb], [MachineType], [AreaLocation], [Line], [Model], [TimeInfo], " & _
                            "[DateStamp], [TimeStamp], [On], [Run], [Ready], [No_Material], [Maintenance], [ProgramInfo], " & _
                            "[Item], [AccountNumb], [Speed], [PlaceHolder], [OperatorInfo], [IDCode], [WorkTime], [Count], [PlaceHolder1], " & _
                            "[PlaceHolder2]) " & _
                            "VALUES (@MachineID, @SerialNumb, @MachineType, @AreaLocation, @Line, @Model, @TimeInfo, @DataStamp, @TimeStamp, @On, " & _
                            "@Run, @Ready, @No_Material, @Maintenance, @ProgramInfo, @Item, @AccountNumb, @Speed, @PlaceHolder, @OperatorInfo, " & _
                            "@IDCode, @WorkTime, @Count, @PlaceHolder1, @PlaceHolder2);"
                SqlCode = _
                            "UPDATE [AutoUpdateTable] SET [MachineID] = @MachineID, [SerialNumb] = @SerialNumb, [MachineType] = @MachineType, " & _
                            "[AreaLocation] = @AreaLocation, [Line] = @Line, [Model] = @Model, [TimeInfo] = @TimeInfo, [DateStamp] = @DateStamp, " & _
                            "[TimeStamp] = @TimeStamp, [On] = @On, [Run] = @Run, [Ready] = @Ready, [No_Material] = @No_Material, [Maintenance] = @Maintenance, " & _
                            "[ProgramInfo] = @ProgramInfo, [Item] = @Item, [AccountNumb] = @AccountNumb, [Speed] = @Speed, [PlaceHolder] = @PlaceHolder, " & _
                            "[OperatorInfo] = @OperatorInfo, [IDCode] = @IDCode, [WorkTime] = @WorkTime, [Count] = @Count, [PlaceHolder1] = @PlaceHolder1, " & _
                            "[PlaceHolder2] = @PlaceHolder2 WHERE [SerialNumb] = " & MyDataArray(1)


                Dim con = New OleDb.OleDbConnection(MyDB)
                Dim cmd = New OleDb.OleDbCommand(SqlQuery, con)

                cmd.CommandText = "SELECT * FROM [AutoUpdateTableQuery] " & _
                            "WHERE  [SerialNumb] = @SN "

                cmd.CommandTimeout = 20
                Thread.Sleep(1000)

                con.Open()

                cmd.Parameters.Clear()
                If MyDataArray(7) = "" Then
                    MyDate = Today()
                ElseIf MyDataArray(7) = "0-0-0" Then
                    MyDate = Today
                ElseIf Not MyDataArray(7) = "" Then
                    MyDate = Convert.ToDateTime(MyDataArray(7))
                ElseIf Not MyDataArray(7) = "0-0-0" Then
                    MyDate = Convert.ToDateTime(MyDataArray(7))
                End If


                MyTime = Convert.ToDateTime(MyDataArray(8))


                cmd.Parameters.AddWithValue("@SN", MyDataArray(1))

                'cmd.Parameters.AddWithValue("@DS", OleDb.OleDbType.DBDate).Value = MyDate


                Dim dr As OleDbDataReader = cmd.ExecuteReader(Commandbehavior.CloseConnection)


                If dr.HasRows = False Then



                    con = New OleDb.OleDbConnection(MyDB)
                    cmd = New OleDb.OleDbCommand(SSQLCode, con)

                    con.Open()


                    'MyDate = Convert.ToDateTime(MyDataArray(7))
                    MyTime = Convert.ToDateTime(MyDataArray(8))

                    cmd.Parameters.Clear()
                    cmd.Parameters.AddWithValue("@MachineID", MyDataArray(0))
                    cmd.Parameters.AddWithValue("@SerialNumb", OleDb.OleDbType.Integer).Value = MyDataArray(1)
                    cmd.Parameters.AddWithValue("@MachineType", OleDb.OleDbType.Integer).Value = MyDataArray(2)
                    cmd.Parameters.AddWithValue("@AreaLocation", OleDb.OleDbType.Integer).Value = MyDataArray(3)
                    cmd.Parameters.AddWithValue("@Line", OleDb.OleDbType.Integer).Value = MyDataArray(4)
                    cmd.Parameters.AddWithValue("@Model", OleDb.OleDbType.Integer).Value = MyDataArray(5)
                    cmd.Parameters.AddWithValue("@TimeInfo", MyDataArray(6))
                    cmd.Parameters.AddWithValue("@'DateStamp'", OleDb.OleDbType.DBDate).Value = MyDate
                    cmd.Parameters.AddWithValue("@'TimeStamp'", OleDb.OleDbType.DBTimeStamp).Value = MyTime
                    cmd.Parameters.AddWithValue("@On", OleDb.OleDbType.Integer).Value = MyDataArray(9)
                    cmd.Parameters.AddWithValue("@Run", OleDb.OleDbType.Integer).Value = MyDataArray(10)
                    cmd.Parameters.AddWithValue("@Ready", OleDb.OleDbType.Integer).Value = MyDataArray(11)
                    cmd.Parameters.AddWithValue("@No_Material", OleDb.OleDbType.Integer).Value = MyDataArray(12)
                    cmd.Parameters.AddWithValue("@Maintenance", OleDb.OleDbType.Integer).Value = MyDataArray(13)
                    cmd.Parameters.AddWithValue("@ProgramInfo", MyDataArray(14))
                    cmd.Parameters.AddWithValue("@Item", OleDb.OleDbType.Integer).Value = MyDataArray(15)
                    cmd.Parameters.AddWithValue("@AccountNumb", OleDb.OleDbType.Integer).Value = MyDataArray(16)
                    cmd.Parameters.AddWithValue("@Speed", OleDb.OleDbType.Integer).Value = MyDataArray(17)
                    cmd.Parameters.AddWithValue("@PlaceHolder", OleDb.OleDbType.Integer).Value = MyDataArray(18)
                    cmd.Parameters.AddWithValue("@OperatorInfo", MyDataArray(19))
                    cmd.Parameters.AddWithValue("@IDCode", OleDb.OleDbType.Integer).Value = MyDataArray(20)
                    cmd.Parameters.AddWithValue("@WorkTime", OleDb.OleDbType.Integer).Value = MyDataArray(21)
                    cmd.Parameters.AddWithValue("@Count", OleDb.OleDbType.Integer).Value = MyDataArray(22)
                    cmd.Parameters.AddWithValue("@PlaceHolder1", OleDb.OleDbType.Integer).Value = MyDataArray(23)
                    cmd.Parameters.AddWithValue("@PlaceHolder2", OleDb.OleDbType.Integer).Value = MyDataArray(24)
                    'cmd.Parameters.AddWithValue("@PlaceHolder_3", OleDb.OleDbType.Char).Value = MyDataArray(25)
                    'cmd.Parameters.AddWithValue("@PlaceHolder_4", OleDb.OleDbType.Integer).Value = MyDataArray(26)
                    'cmd.Parameters.AddWithValue("@PlaceHolder_5", OleDb.OleDbType.Integer).Value = MyDataArray(27)
                    'cmd.Parameters.AddWithValue("@PlaceHolder_6", OleDb.OleDbType.Integer).Value = MyDataArray(28)
                    'cmd.Parameters.AddWithValue("@PlaceHolder_7", OleDb.OleDbType.Integer).Value = MyDataArray(29)
                    'cmd.Parameters.AddWithValue("@PlaceHolder_8", OleDb.OleDbType.Variant).Value = MyDataArray(30)
                    Thread.Sleep(1000)
                    cmd.ExecuteNonQuery()






                Else

                    '
                    'If data found in database then add data to table
                    '

                    con = New OleDb.OleDbConnection(MyDB)
                    cmd = New OleDb.OleDbCommand(SqlCode, con)

                    con.Open()


                    'MyDate = Convert.ToDateTime(MyDataArray(7))
                    MyTime = Convert.ToDateTime(MyDataArray(8))

                    cmd.Parameters.Clear()
                    cmd.Parameters.AddWithValue("@MachineID", MyDataArray(0))
                    cmd.Parameters.AddWithValue("@SerialNumb", OleDb.OleDbType.Integer).Value = MyDataArray(1)
                    cmd.Parameters.AddWithValue("@MachineType", OleDb.OleDbType.Integer).Value = MyDataArray(2)
                    cmd.Parameters.AddWithValue("@AreaLocation", OleDb.OleDbType.Integer).Value = MyDataArray(3)
                    cmd.Parameters.AddWithValue("@Line", OleDb.OleDbType.Integer).Value = MyDataArray(4)
                    cmd.Parameters.AddWithValue("@Model", OleDb.OleDbType.Integer).Value = MyDataArray(5)
                    cmd.Parameters.AddWithValue("@TimeInfo", MyDataArray(6))
                    cmd.Parameters.AddWithValue("@'DateStamp'", OleDb.OleDbType.DBDate).Value = MyDate
                    cmd.Parameters.AddWithValue("@'TimeStamp'", OleDb.OleDbType.DBTimeStamp).Value = MyTime
                    cmd.Parameters.AddWithValue("@On", OleDb.OleDbType.Integer).Value = MyDataArray(9)
                    cmd.Parameters.AddWithValue("@Run", OleDb.OleDbType.Integer).Value = MyDataArray(10)
                    cmd.Parameters.AddWithValue("@Ready", OleDb.OleDbType.Integer).Value = MyDataArray(11)
                    cmd.Parameters.AddWithValue("@No_Material", OleDb.OleDbType.Integer).Value = MyDataArray(12)
                    cmd.Parameters.AddWithValue("@Maintenance", OleDb.OleDbType.Integer).Value = MyDataArray(13)
                    cmd.Parameters.AddWithValue("@ProgramInfo", MyDataArray(14))
                    cmd.Parameters.AddWithValue("@Item", OleDb.OleDbType.Integer).Value = MyDataArray(15)
                    cmd.Parameters.AddWithValue("@AccountNumb", OleDb.OleDbType.Integer).Value = MyDataArray(16)
                    cmd.Parameters.AddWithValue("@Speed", OleDb.OleDbType.Integer).Value = MyDataArray(17)
                    cmd.Parameters.AddWithValue("@PlaceHolder", OleDb.OleDbType.Integer).Value = MyDataArray(18)
                    cmd.Parameters.AddWithValue("@OperatorInfo", MyDataArray(19))
                    cmd.Parameters.AddWithValue("@IDCode", OleDb.OleDbType.Integer).Value = MyDataArray(20)
                    cmd.Parameters.AddWithValue("@WorkTime", OleDb.OleDbType.Integer).Value = MyDataArray(21)
                    cmd.Parameters.AddWithValue("@Count", OleDb.OleDbType.Integer).Value = MyDataArray(22)
                    cmd.Parameters.AddWithValue("@PlaceHolder1", OleDb.OleDbType.Integer).Value = MyDataArray(23)
                    cmd.Parameters.AddWithValue("@PlaceHolder2", OleDb.OleDbType.Integer).Value = MyDataArray(24)
                    'cmd.Parameters.AddWithValue("@PlaceHolder_3", OleDb.OleDbType.Char).Value = MyDataArray(25)
                    'cmd.Parameters.AddWithValue("@PlaceHolder_4", OleDb.OleDbType.Integer).Value = MyDataArray(26)
                    'cmd.Parameters.AddWithValue("@PlaceHolder_5", OleDb.OleDbType.Integer).Value = MyDataArray(27)
                    'cmd.Parameters.AddWithValue("@PlaceHolder_6", OleDb.OleDbType.Integer).Value = MyDataArray(28)
                    'cmd.Parameters.AddWithValue("@PlaceHolder_7", OleDb.OleDbType.Integer).Value = MyDataArray(29)
                    'cmd.Parameters.AddWithValue("@PlaceHolder_8", OleDb.OleDbType.Variant).Value = MyDataArray(30)
                    Thread.Sleep(1000)
                    cmd.ExecuteNonQuery()

                    '


                End If




                m = m + 1


                Sql = "SELECT * FROM [AutoUpdateTableQuery]"


                con = New OleDb.OleDbConnection(MyDB)
                cmd = New OleDb.OleDbCommand(Sql, con)

                con.Open()

                Thread.Sleep(1000)


                MyDataArray = Nothing

            Loop
            n = 0

            'TCP Terminate Connection

            tcpClient.Close()
        Next ip
Lucky:

    End Sub
End Class

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1