473,379 Members | 1,185 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Unable to read data from the transport Connection

Cintury
81
Hi all,

I've developed a mobile application for windows mobile 5.0 that has been in use for a while (1 year and a couple of months). It was developed in visual studios 2005 with a back-end sql server mobile ce database. Until recently I was synching everything thru a com port serial cable. The devices would connect to the computer thru activesync and are able to acquire an internet connection. The sync for the program occurs thru a website stored locally on my computer that then places the data in a local Access database.

As I said this has all been working fine, however at the beginning of the week our server crashed and since its been repaired everytime I try to upload the data I get Upload Failure: unable to read data from the transport connection.

Now two of the mobile devices will still upload data intermittenly out of 16. I've checked the settings on the devices and they are all the same. They can all access the internet thru pocket explorer when connected to the computer via the cable. I've checked my code and the connection timeout is set to 600000 seconds. Please ,please help me with this issue as I really have a backlog of data piling up on me.

Web Method
Expand|Select|Wrap|Line Numbers
  1. Imports System.Web
  2. Imports System.Data.OleDb
  3. Imports System.Data
  4. Imports System.Web.Services
  5. Imports System.Web.Services.Protocols
  6.  
  7. <WebService(Namespace:="http://tempuri.org/")> _
  8. <WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
  9. <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
  10. Public Class Access
  11.     Inherits System.Web.Services.WebService
  12.  
  13.     <WebMethod()> _
  14.     Public Function HelloWorld() As String
  15.         Return "Hello World"
  16.     End Function
  17.  
  18.     <System.Web.Services.WebMethod()> _
  19.     Public Function GetAccessData(ByVal command As String) As DataSet
  20.         Dim dataset As DataSet = Nothing
  21.         ' Connect to Access DB here, execute command and populate data set with returned data.
  22.  
  23.         Return dataset
  24.  
  25.     End Function
  26.  
  27.     ' UpdateAccessData connects to and access database and inserts the data tables into the correct locations.
  28.     ' Parameters: DonorChanges as DataSet. DonorChanges is the dataset of pick-ups and deliverys.
  29.     ' Return value: Boolean. Success or failure.
  30.     <System.Web.Services.WebMethod()> _
  31.     Public Function UpdateAccessData(ByVal DonorChanges As DataSet) As Boolean
  32.         Me.Server.ScriptTimeout = 60000000
  33.         Dim DonorStartingRows As Integer
  34.         Dim AgencyStartingRows As Integer
  35.         Dim LinkStartingRows As Integer
  36.         'Dim DriverStartingRows As Integer
  37.  
  38.         ' Connection string to connect to access database
  39.         Dim FHDB As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\testpre\\Replica_of_be\Replica_of_harvest2000_be.mdb;User Id=admin;Password=;")
  40.  
  41.         ' Table adapter to get information from tables in the database
  42.         Dim daFoodDonor As New OleDb.OleDbDataAdapter("select * from tblFoodDonations", FHDB)
  43.         ' Data table to store info
  44.         Dim FoodDonorTable As New DataTable
  45.  
  46.         ' Fill the data table with info
  47.         daFoodDonor.Fill(FoodDonorTable)
  48.         daFoodDonor.Dispose()
  49.         ' No longer using this adapter so free memory
  50.  
  51.         DonorStartingRows = FoodDonorTable.Rows.Count
  52.  
  53.         FoodDonorTable.Dispose()
  54.  
  55.         ' Find the number of rows we will be inserting
  56.         Dim rowsDonor As Integer = DonorChanges.Tables(0).Rows.Count
  57.         ' insert that number of rows
  58.         For rowsCount As Integer = 1 To rowsDonor
  59.             Dim addDonorReciepts As New OleDb.OleDbCommand ' Declare new command
  60.             Dim oneRowDon As DataRow = DonorChanges.Tables(0).Rows.Item((rowsCount - 1)) ' The row to be inserted
  61.             Dim julda As Long = CLng(Format(Year(oneRowDon.Item(8)), "0000") _
  62.                   + Format(DateDiff("d", CDate("01/01/" _
  63.                   + Format(Year(oneRowDon.Item(8)), "0000")), oneRowDon.Item(8)) _
  64.                   + 1, "000"))
  65.             Dim mt As String = String.Concat(oneRowDon.Item(9).Hours.ToString, _
  66.                                     oneRowDon.Item(9).Minutes.ToString, _
  67.                                     oneRowDon.Item(9).Seconds.ToString)
  68.             Dim uniID As String = String.Concat(julda.ToString, mt.ToString, oneRowDon.Item(10).ToString)
  69.             If oneRowDon.Item(1).Equals("Inventory") Then
  70.                 DonorStartingRows = DonorStartingRows - 1
  71.             Else
  72.                 With addDonorReciepts
  73.                     .CommandTimeout = 600000
  74.                     'insert command
  75.                     .CommandText = "insert into tblFoodDonations ([Date], [Donor Time], [Bakery], [Meat]," & _
  76.                     "[Fruit], [Dairy], [Vegetable], [Prepared], [Juice], [Non-Perishable], [Non-Food]," & _
  77.                     "[Total Donations], [DonorReceiptId], Driver, TruckNumber, DonorID, FoodDonationsID)" & _
  78.                     "values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
  79.                     .Parameters.Add(New OleDbParameter("Date", oneRowDon.Item(8).Date))
  80.                     .Parameters.Add(New OleDbParameter("Time", oneRowDon.Item(9)))
  81.                     .Parameters.Add(New OleDbParameter("Bakery", oneRowDon.Item(12)))
  82.                     .Parameters.Add(New OleDbParameter("Meat", oneRowDon.Item(14)))
  83.                     .Parameters.Add(New OleDbParameter("Fruit", oneRowDon.Item(15)))
  84.                     .Parameters.Add(New OleDbParameter("Dairy", oneRowDon.Item(13)))
  85.                     .Parameters.Add(New OleDbParameter("Vege", oneRowDon.Item(16)))
  86.                     .Parameters.Add(New OleDbParameter("Prep", oneRowDon.Item(17)))
  87.                     .Parameters.Add(New OleDbParameter("Juice", oneRowDon.Item(20)))
  88.                     .Parameters.Add(New OleDbParameter("NP", oneRowDon.Item(21)))
  89.                     .Parameters.Add(New OleDbParameter("NF", oneRowDon.Item(22)))
  90.                     .Parameters.Add(New OleDbParameter("Total", oneRowDon.Item(23)))
  91.                     .Parameters.Add(New OleDbParameter("ReceiptID", uniID))
  92.                     .Parameters.Add(New OleDbParameter("Driver", oneRowDon.Item(11)))
  93.                     .Parameters.Add(New OleDbParameter("Truck", oneRowDon.Item(10)))
  94.                     .Parameters.Add(New OleDbParameter("DonorID", oneRowDon.Item(0)))
  95.                     .Parameters.Add(New OleDbParameter("FoodID", uniID))
  96.                     Dim fs As IO.FileStream = New IO.FileStream("C:\testpre\Signature\Donor\" & uniID & ".bmp", IO.FileMode.Create)
  97.                     fs.Write(oneRowDon.Item(19), 0, oneRowDon.Item(19).Length)
  98.                     fs.Flush()
  99.                     fs.Close()
  100.                     .Connection = FHDB ' connection string
  101.                     .Connection.Open() ' open connection
  102.                     .ExecuteNonQuery() ' execute command
  103.                     .Connection.Close() ' close connection
  104.                     .Dispose() ' free memory
  105.                 End With
  106.                 For linkRowNum As Integer = 0 To DonorChanges.Tables(2).Rows.Count - 1
  107.                     If DonorChanges.Tables(2).Rows(linkRowNum).Item(1).Equals(oneRowDon.Item(24).ToString) Then
  108.                         DonorChanges.Tables(2).Rows(linkRowNum).Item(1) = uniID
  109.                     End If
  110.                 Next
  111.             End If
  112.         Next
  113.  
  114.         Dim daAgencyRec As New OleDb.OleDbDataAdapter("select * from tblAgencyReceipt", FHDB)
  115.         Dim AgencyRecTable As New DataTable
  116.  
  117.         daAgencyRec.Fill(AgencyRecTable)
  118.         daAgencyRec.Dispose()
  119.  
  120.         AgencyStartingRows = AgencyRecTable.Rows.Count
  121.  
  122.         AgencyRecTable.Dispose()
  123.  
  124.         ' Find the number of rows we will be inserting
  125.         Dim rowsAgency As Integer = DonorChanges.Tables(1).Rows.Count
  126.         ' insert that number of rows
  127.         For rowscount As Integer = 1 To rowsAgency
  128.             Dim addAgeRec As New OleDb.OleDbCommand ' Declare new command
  129.             Dim oneRowAge As DataRow = DonorChanges.Tables(1).Rows.Item((rowscount - 1)) ' The row to be inserted
  130.             Dim julda As Long = CLng(Format(Year(oneRowAge.Item(8)), "0000") _
  131.                   + Format(DateDiff("d", CDate("01/01/" _
  132.                   + Format(Year(oneRowAge.Item(8)), "0000")), oneRowAge.Item(8)) _
  133.                   + 1, "000"))
  134.             Dim mt As String = String.Concat(oneRowAge.Item(9).Hours.ToString, _
  135.                                     oneRowAge.Item(9).Minutes.ToString, _
  136.                                     oneRowAge.Item(9).Seconds.ToString)
  137.             Dim uniID As String = String.Concat(julda.ToString, mt.ToString, oneRowAge.Item(10).ToString)
  138.             If oneRowAge.Item(1).Equals("Inventory") Then
  139.                 AgencyStartingRows = AgencyStartingRows - 1
  140.             Else
  141.                 With addAgeRec
  142.                     .CommandTimeout = 600000
  143.                     'insert command
  144.                     .CommandText = "insert into tblAgencyReceipt (AgencyReceiptId, [Date], ReceiverId, Bakery," & _
  145.                     "Dairy, Meat, Fruit, Vegetable, Prepared, [Non-Perishable], [Non-Food], [DateEntered], Driver," & _
  146.                     "TruckNumber, DropTime, Juice, ReceiptID) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
  147.                     .Parameters.Add(New OleDbParameter("AgencyRecID", uniID))
  148.                     .Parameters.Add(New OleDbParameter("Date", oneRowAge.Item(8).Date))
  149.                     .Parameters.Add(New OleDbParameter("ReceiverID", oneRowAge.Item(0)))
  150.                     .Parameters.Add(New OleDbParameter("Bakery", oneRowAge.Item(13)))
  151.                     .Parameters.Add(New OleDbParameter("Dairy", oneRowAge.Item(14)))
  152.                     .Parameters.Add(New OleDbParameter("Meat", oneRowAge.Item(15)))
  153.                     .Parameters.Add(New OleDbParameter("Fruit", oneRowAge.Item(16)))
  154.                     .Parameters.Add(New OleDbParameter("Vege", oneRowAge.Item(17)))
  155.                     .Parameters.Add(New OleDbParameter("Prep", oneRowAge.Item(18)))
  156.                     .Parameters.Add(New OleDbParameter("NP", oneRowAge.Item(20)))
  157.                     .Parameters.Add(New OleDbParameter("NF", oneRowAge.Item(21)))
  158.                     .Parameters.Add(New OleDbParameter("DateEnt", DateTime.Today))
  159.                     .Parameters.Add(New OleDbParameter("Driver", oneRowAge.Item(11)))
  160.                     .Parameters.Add(New OleDbParameter("Truck", oneRowAge.Item(10)))
  161.                     .Parameters.Add(New OleDbParameter("Time", oneRowAge.Item(9)))
  162.                     .Parameters.Add(New OleDbParameter("Juice", oneRowAge.Item(19)))
  163.                     .Parameters.Add(New OleDbParameter("ReceiptID", uniID))
  164.                     Dim fs As IO.FileStream = New IO.FileStream("C:\testpre\Signature\Agency\" & uniID & ".bmp", IO.FileMode.Create)
  165.                     fs.Write(oneRowAge.Item(12), 0, oneRowAge.Item(12).Length)
  166.                     fs.Flush()
  167.                     fs.Close()
  168.                     .Connection = FHDB ' connection string
  169.                     .Connection.Open() ' open connection
  170.                     .ExecuteNonQuery() ' execute command
  171.                     .Connection.Close() ' close connection
  172.                     .Dispose() ' free memory
  173.                 End With
  174.                 For linkRowNum As Integer = 0 To DonorChanges.Tables(2).Rows.Count - 1
  175.                     If DonorChanges.Tables(2).Rows(linkRowNum).Item(0).Equals(oneRowAge.Item(23).ToString) Then
  176.                         DonorChanges.Tables(2).Rows(linkRowNum).Item(0) = uniID
  177.                     End If
  178.                 Next
  179.             End If
  180.         Next
  181.         Dim rowsInventory As Integer = DonorChanges.Tables(3).Rows.Count
  182.  
  183.         For rowscount As Integer = 1 To rowsInventory
  184.             Dim addInventoryRec As New OleDb.OleDbCommand
  185.             Dim oneRowInv As DataRow = DonorChanges.Tables(3).Rows.Item((rowscount - 1))
  186.             DonorStartingRows = DonorStartingRows + 1
  187.             With addInventoryRec
  188.                 .CommandTimeout = 600000
  189.                 .CommandText = "insert into tblFoodDonations ([Date], [Donor Time], [Bakery], [Meat]," & _
  190.                     "[Fruit], [Dairy], [Vegetable], [Prepared], [Juice], [Non-Perishable], [Non-Food]," & _
  191.                     "[Total Donations], [DonorReceiptId], Driver, TruckNumber, DonorID, FoodDonationsID, Description, InventoryTypeId)" & _
  192.                     "values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
  193.                 .Parameters.Add(New OleDbParameter("Date", oneRowInv.Item(10).Date))
  194.                 .Parameters.Add(New OleDbParameter("Time", oneRowInv.Item(11)))
  195.                 .Parameters.Add(New OleDbParameter("Bakery", oneRowInv.Item(1)))
  196.                 .Parameters.Add(New OleDbParameter("Meat", oneRowInv.Item(3)))
  197.                 .Parameters.Add(New OleDbParameter("Fruit", oneRowInv.Item(4)))
  198.                 .Parameters.Add(New OleDbParameter("Dairy", oneRowInv.Item(2)))
  199.                 .Parameters.Add(New OleDbParameter("Vege", oneRowInv.Item(5)))
  200.                 .Parameters.Add(New OleDbParameter("Prep", oneRowInv.Item(6)))
  201.                 .Parameters.Add(New OleDbParameter("Juice", oneRowInv.Item(7)))
  202.                 .Parameters.Add(New OleDbParameter("NP", oneRowInv.Item(8)))
  203.                 .Parameters.Add(New OleDbParameter("NF", oneRowInv.Item(9)))
  204.                 .Parameters.Add(New OleDbParameter("Total", oneRowInv.Item(23)))
  205.                 .Parameters.Add(New OleDbParameter("ReceiptID", oneRowInv.Item(0)))
  206.                 .Parameters.Add(New OleDbParameter("Driver", oneRowInv.Item(12)))
  207.                 .Parameters.Add(New OleDbParameter("Truck", oneRowInv.Item(13)))
  208.                 .Parameters.Add(New OleDbParameter("DonorID", oneRowInv.Item(24)))
  209.                 .Parameters.Add(New OleDbParameter("FoodID", oneRowInv.Item(0)))
  210.                 .Parameters.Add(New OleDbParameter("Description", oneRowInv.Item(25)))
  211.                 .Parameters.Add(New OleDbParameter("InvTypeID", 1))
  212.                 .Connection = FHDB ' connection string
  213.                 .Connection.Open() ' open connection
  214.                 .ExecuteNonQuery() ' execute command
  215.                 .Connection.Close() ' close connection
  216.                 .Dispose() ' free memory
  217.             End With
  218.         Next
  219.  
  220.         Dim daLink As New OleDb.OleDbDataAdapter("select * from tblAgencyDonationLink", FHDB)
  221.         Dim LinkTable As New DataTable
  222.         daLink.Fill(LinkTable)
  223.  
  224.         LinkStartingRows = LinkTable.Rows.Count
  225.         daLink.Dispose()
  226.         LinkTable.Dispose()
  227.  
  228.         Dim rowsLink As Integer = DonorChanges.Tables(2).Rows.Count
  229.  
  230.         For rowscount As Integer = 1 To rowsLink
  231.             Dim addLinkRec As New OleDb.OleDbCommand ' Declare new command
  232.             Dim oneRowLink As DataRow = DonorChanges.Tables(2).Rows.Item((rowscount - 1)) ' The row to be inserted
  233.             With addLinkRec
  234.                 .CommandTimeout = 600000
  235.                 'insert command
  236.                 .CommandText = "insert into tblAgencyDonationLink (ReceiptID, FoodDonationsID, Bakery, Dairy, Meat," _
  237.                 & "Fruit, Vegetable, Prepared, Beverage, [Non-Perishable], [Non-Food], DateEntered, DistributionDate)" _
  238.                 & "values (?,?,?,?,?,?,?,?,?,?,?,?,?)"
  239.                 .Parameters.Add(New OleDbParameter("ReceiptID", oneRowLink.Item(0)))
  240.                 .Parameters.Add(New OleDbParameter("FoodID", oneRowLink.Item(1)))
  241.                 .Parameters.Add(New OleDbParameter("Bakery", oneRowLink.Item(2)))
  242.                 .Parameters.Add(New OleDbParameter("Dairy", oneRowLink.Item(3)))
  243.                 .Parameters.Add(New OleDbParameter("Meat", oneRowLink.Item(4)))
  244.                 .Parameters.Add(New OleDbParameter("Fruit", oneRowLink.Item(5)))
  245.                 .Parameters.Add(New OleDbParameter("Vege", oneRowLink.Item(6)))
  246.                 .Parameters.Add(New OleDbParameter("Prep", oneRowLink.Item(7)))
  247.                 .Parameters.Add(New OleDbParameter("Bev", oneRowLink.Item(8)))
  248.                 .Parameters.Add(New OleDbParameter("NP", oneRowLink.Item(9)))
  249.                 .Parameters.Add(New OleDbParameter("NF", oneRowLink.Item(10)))
  250.                 .Parameters.Add(New OleDbParameter("DateEnt", DateTime.Today))
  251.                 .Parameters.Add(New OleDbParameter("DistDate", oneRowLink.Item(11)))
  252.                 .Connection = FHDB ' connection string
  253.                 .Connection.Open() ' open connection
  254.                 .ExecuteNonQuery() ' execute command
  255.                 .Connection.Close() ' close connection
  256.                 .Dispose() ' free memory
  257.             End With
  258.         Next
  259.  
  260.         FHDB.Dispose() ' No longer need the sting free the memory
  261.         ' If all the rows were send return true else thor exeption to catch
  262.         If EndOfTables(DonorStartingRows, AgencyStartingRows, LinkStartingRows, DonorChanges) Then
  263.             Return True
  264.         Else
  265.             Throw New ArithmeticException
  266.         End If
  267.  
  268.     End Function
  269.  
  270.     <System.Web.Services.WebMethod()> _
  271.     Public Function EndOfTables(ByVal DonorStartingRows As Integer, ByVal AgencyStartingRows As Integer, ByVal LinkStartingRows As Integer, ByVal DonorChanges As DataSet) As Boolean
  272.         Me.Server.ScriptTimeout = 600000
  273.         ' Connection string to connect to access database
  274.         Dim FHDB As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\testpre\Replica_of_be\Replica_of_harvest2000_be.mdb;User Id=admin;Password=;")
  275.  
  276.         ' Table adapter to get information from tables in the database
  277.         Dim daFoodDonor As New OleDb.OleDbDataAdapter("select * from tblFoodDonations", FHDB)
  278.         Dim daAgencyRec As New OleDb.OleDbDataAdapter("select * from tblAgencyReceipt", FHDB)
  279.         Dim daLink As New OleDb.OleDbDataAdapter("select * from tblAgencyDonationLink", FHDB)
  280.         ' Data table to store info
  281.         Dim FoodDonorTable As New DataTable
  282.         Dim AgencyRecTable As New DataTable
  283.         Dim LinkTable As New DataTable
  284.         ' Fill the data table with info
  285.         daFoodDonor.Fill(FoodDonorTable)
  286.         daAgencyRec.Fill(AgencyRecTable)
  287.         daLink.Fill(LinkTable)
  288.         ' Free some memory
  289.         daFoodDonor.Dispose()
  290.         daAgencyRec.Dispose()
  291.         daLink.Dispose()
  292.         ' The number of rows that is supposed to be sent
  293.         Dim DonorTargetRows As Integer = DonorChanges.Tables(0).Rows.Count
  294.         Dim AgencyTargetRows As Integer = DonorChanges.Tables(1).Rows.Count
  295.         Dim LinkTargetRows As Integer = DonorChanges.Tables(2).Rows.Count
  296.         ' free some memory
  297.         DonorChanges.Dispose()
  298.         ' The total number of rows after data has been sent
  299.         Dim DonorEndingRows As Integer = FoodDonorTable.Rows.Count
  300.         Dim AgencyEndingRows As Integer = AgencyRecTable.Rows.Count
  301.         Dim LinkEndingRows As Integer = LinkTable.Rows.Count
  302.         ' free some memory
  303.         FoodDonorTable.Dispose()
  304.         AgencyRecTable.Dispose()
  305.         LinkTable.Dispose()
  306.         ' The number of rows sent
  307.         Dim DonorRows As Integer = DonorEndingRows - DonorStartingRows
  308.         Dim AgencyRows As Integer = AgencyEndingRows - AgencyStartingRows
  309.         Dim LinkRows As Integer = LinkEndingRows - LinkStartingRows
  310.         ' If everything equals return true if not return false
  311.         If DonorRows.Equals(DonorTargetRows) And _
  312.            AgencyRows.Equals(AgencyTargetRows) And _
  313.            LinkRows.Equals(LinkTargetRows) Then
  314.             Return True
  315.         Else
  316.             Return False
  317.         End If
  318.     End Function
  319.  
  320. End Class
  321.  
  322.  
  323.  



Thank you!
Aug 30 '07 #1
6 8119
Cintury
81
test test test test test
Aug 30 '07 #2
Cintury
81
Hi all,

I've developed a mobile application for windows mobile 5.0 that has been in use for a while (1 year and a couple of months). It was developed in Visual studios 2005 with a back end sql mobile ce database. Until recently I was syncing everything thru a com port serial cable. The devices would connect to the computer thru activesync and are able to aquire an internet connection. The sync for the program occurs thru a website stored locally on my computer that then places the data in a local Access database.

As I said this has all been working fine, however at the beginning of the week our server crashed (8/28/2007) and since its been repaired, everytime I try to upload the data I get Upload Failure: Unable to read the data from the transport connection.

Now two of the mobile devices will still upload data intermittenly out of 16. I've checked the settings on the devices and they are all the same. They all access the internet thru pocket explorer when connected thru the cable. I've checked my code and the connection timeout is set to 600000 seconds. Please, please help me with this issue as I really have a backlog of data piling up on me.

Expand|Select|Wrap|Line Numbers
  1. Imports System.Web
  2. Imports System.Data.OleDb
  3. Imports System.Data
  4. Imports System.Web.Services
  5. Imports System.Web.Services.Protocols
  6.  
  7. <WebService(Namespace:="http://tempuri.org/")> _
  8. <WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
  9. <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
  10. Public Class Access
  11.     Inherits System.Web.Services.WebService
  12.  
  13.     <WebMethod()> _
  14.     Public Function HelloWorld() As String
  15.         Return "Hello World"
  16.     End Function
  17.  
  18.     <System.Web.Services.WebMethod()> _
  19.     Public Function GetAccessData(ByVal command As String) As DataSet
  20.         Dim dataset As DataSet = Nothing
  21.         ' Connect to Access DB here, execute command and populate data set with returned data.
  22.  
  23.         Return dataset
  24.  
  25.     End Function
  26.  
  27.     ' UpdateAccessData connects to and access database and inserts the data tables into the correct locations.
  28.     ' Parameters: DonorChanges as DataSet. DonorChanges is the dataset of pick-ups and deliverys.
  29.     ' Return value: Boolean. Success or failure.
  30.     <System.Web.Services.WebMethod()> _
  31.     Public Function UpdateAccessData(ByVal DonorChanges As DataSet) As Boolean
  32.         Me.Server.ScriptTimeout = 60000000
  33.         Dim DonorStartingRows As Integer
  34.         Dim AgencyStartingRows As Integer
  35.         Dim LinkStartingRows As Integer
  36.         'Dim DriverStartingRows As Integer
  37.  
  38.         ' Connection string to connect to access database
  39.         Dim FHDB As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\testpre\\Replica_of_be\Replica_of_harvest2000_be.mdb;User Id=admin;Password=;")
  40.  
  41.         ' Table adapter to get information from tables in the database
  42.         Dim daFoodDonor As New OleDb.OleDbDataAdapter("select * from tblFoodDonations", FHDB)
  43.         ' Data table to store info
  44.         Dim FoodDonorTable As New DataTable
  45.  
  46.         ' Fill the data table with info
  47.         daFoodDonor.Fill(FoodDonorTable)
  48.         daFoodDonor.Dispose()
  49.         ' No longer using this adapter so free memory
  50.  
  51.         DonorStartingRows = FoodDonorTable.Rows.Count
  52.  
  53.         FoodDonorTable.Dispose()
  54.  
  55.         ' Find the number of rows we will be inserting
  56.         Dim rowsDonor As Integer = DonorChanges.Tables(0).Rows.Count
  57.         ' insert that number of rows
  58.         For rowsCount As Integer = 1 To rowsDonor
  59.             Dim addDonorReciepts As New OleDb.OleDbCommand ' Declare new command
  60.             Dim oneRowDon As DataRow = DonorChanges.Tables(0).Rows.Item((rowsCount - 1)) ' The row to be inserted
  61.             Dim julda As Long = CLng(Format(Year(oneRowDon.Item(8)), "0000") _
  62.                   + Format(DateDiff("d", CDate("01/01/" _
  63.                   + Format(Year(oneRowDon.Item(8)), "0000")), oneRowDon.Item(8)) _
  64.                   + 1, "000"))
  65.             Dim mt As String = String.Concat(oneRowDon.Item(9).Hours.ToString, _
  66.                                     oneRowDon.Item(9).Minutes.ToString, _
  67.                                     oneRowDon.Item(9).Seconds.ToString)
  68.             Dim uniID As String = String.Concat(julda.ToString, mt.ToString, oneRowDon.Item(10).ToString)
  69.             If oneRowDon.Item(1).Equals("Inventory") Then
  70.                 DonorStartingRows = DonorStartingRows - 1
  71.             Else
  72.                 With addDonorReciepts
  73.                     .CommandTimeout = 600000
  74.                     'insert command
  75.                     .CommandText = "insert into tblFoodDonations ([Date], [Donor Time], [Bakery], [Meat]," & _
  76.                     "[Fruit], [Dairy], [Vegetable], [Prepared], [Juice], [Non-Perishable], [Non-Food]," & _
  77.                     "[Total Donations], [DonorReceiptId], Driver, TruckNumber, DonorID, FoodDonationsID)" & _
  78.                     "values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
  79.                     .Parameters.Add(New OleDbParameter("Date", oneRowDon.Item(8).Date))
  80.                     .Parameters.Add(New OleDbParameter("Time", oneRowDon.Item(9)))
  81.                     .Parameters.Add(New OleDbParameter("Bakery", oneRowDon.Item(12)))
  82.                     .Parameters.Add(New OleDbParameter("Meat", oneRowDon.Item(14)))
  83.                     .Parameters.Add(New OleDbParameter("Fruit", oneRowDon.Item(15)))
  84.                     .Parameters.Add(New OleDbParameter("Dairy", oneRowDon.Item(13)))
  85.                     .Parameters.Add(New OleDbParameter("Vege", oneRowDon.Item(16)))
  86.                     .Parameters.Add(New OleDbParameter("Prep", oneRowDon.Item(17)))
  87.                     .Parameters.Add(New OleDbParameter("Juice", oneRowDon.Item(20)))
  88.                     .Parameters.Add(New OleDbParameter("NP", oneRowDon.Item(21)))
  89.                     .Parameters.Add(New OleDbParameter("NF", oneRowDon.Item(22)))
  90.                     .Parameters.Add(New OleDbParameter("Total", oneRowDon.Item(23)))
  91.                     .Parameters.Add(New OleDbParameter("ReceiptID", uniID))
  92.                     .Parameters.Add(New OleDbParameter("Driver", oneRowDon.Item(11)))
  93.                     .Parameters.Add(New OleDbParameter("Truck", oneRowDon.Item(10)))
  94.                     .Parameters.Add(New OleDbParameter("DonorID", oneRowDon.Item(0)))
  95.                     .Parameters.Add(New OleDbParameter("FoodID", uniID))
  96.                     Dim fs As IO.FileStream = New IO.FileStream("C:\testpre\Signature\Donor\" & uniID & ".bmp", IO.FileMode.Create)
  97.                     fs.Write(oneRowDon.Item(19), 0, oneRowDon.Item(19).Length)
  98.                     fs.Flush()
  99.                     fs.Close()
  100.                     .Connection = FHDB ' connection string
  101.                     .Connection.Open() ' open connection
  102.                     .ExecuteNonQuery() ' execute command
  103.                     .Connection.Close() ' close connection
  104.                     .Dispose() ' free memory
  105.                 End With
  106.                 For linkRowNum As Integer = 0 To DonorChanges.Tables(2).Rows.Count - 1
  107.                     If DonorChanges.Tables(2).Rows(linkRowNum).Item(1).Equals(oneRowDon.Item(24).ToString) Then
  108.                         DonorChanges.Tables(2).Rows(linkRowNum).Item(1) = uniID
  109.                     End If
  110.                 Next
  111.             End If
  112.         Next
  113.  
  114.         Dim daAgencyRec As New OleDb.OleDbDataAdapter("select * from tblAgencyReceipt", FHDB)
  115.         Dim AgencyRecTable As New DataTable
  116.  
  117.         daAgencyRec.Fill(AgencyRecTable)
  118.         daAgencyRec.Dispose()
  119.  
  120.         AgencyStartingRows = AgencyRecTable.Rows.Count
  121.  
  122.         AgencyRecTable.Dispose()
  123.  
  124.         ' Find the number of rows we will be inserting
  125.         Dim rowsAgency As Integer = DonorChanges.Tables(1).Rows.Count
  126.         ' insert that number of rows
  127.         For rowscount As Integer = 1 To rowsAgency
  128.             Dim addAgeRec As New OleDb.OleDbCommand ' Declare new command
  129.             Dim oneRowAge As DataRow = DonorChanges.Tables(1).Rows.Item((rowscount - 1)) ' The row to be inserted
  130.             Dim julda As Long = CLng(Format(Year(oneRowAge.Item(8)), "0000") _
  131.                   + Format(DateDiff("d", CDate("01/01/" _
  132.                   + Format(Year(oneRowAge.Item(8)), "0000")), oneRowAge.Item(8)) _
  133.                   + 1, "000"))
  134.             Dim mt As String = String.Concat(oneRowAge.Item(9).Hours.ToString, _
  135.                                     oneRowAge.Item(9).Minutes.ToString, _
  136.                                     oneRowAge.Item(9).Seconds.ToString)
  137.             Dim uniID As String = String.Concat(julda.ToString, mt.ToString, oneRowAge.Item(10).ToString)
  138.             If oneRowAge.Item(1).Equals("Inventory") Then
  139.                 AgencyStartingRows = AgencyStartingRows - 1
  140.             Else
  141.                 With addAgeRec
  142.                     .CommandTimeout = 600000
  143.                     'insert command
  144.                     .CommandText = "insert into tblAgencyReceipt (AgencyReceiptId, [Date], ReceiverId, Bakery," & _
  145.                     "Dairy, Meat, Fruit, Vegetable, Prepared, [Non-Perishable], [Non-Food], [DateEntered], Driver," & _
  146.                     "TruckNumber, DropTime, Juice, ReceiptID) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
  147.                     .Parameters.Add(New OleDbParameter("AgencyRecID", uniID))
  148.                     .Parameters.Add(New OleDbParameter("Date", oneRowAge.Item(8).Date))
  149.                     .Parameters.Add(New OleDbParameter("ReceiverID", oneRowAge.Item(0)))
  150.                     .Parameters.Add(New OleDbParameter("Bakery", oneRowAge.Item(13)))
  151.                     .Parameters.Add(New OleDbParameter("Dairy", oneRowAge.Item(14)))
  152.                     .Parameters.Add(New OleDbParameter("Meat", oneRowAge.Item(15)))
  153.                     .Parameters.Add(New OleDbParameter("Fruit", oneRowAge.Item(16)))
  154.                     .Parameters.Add(New OleDbParameter("Vege", oneRowAge.Item(17)))
  155.                     .Parameters.Add(New OleDbParameter("Prep", oneRowAge.Item(18)))
  156.                     .Parameters.Add(New OleDbParameter("NP", oneRowAge.Item(20)))
  157.                     .Parameters.Add(New OleDbParameter("NF", oneRowAge.Item(21)))
  158.                     .Parameters.Add(New OleDbParameter("DateEnt", DateTime.Today))
  159.                     .Parameters.Add(New OleDbParameter("Driver", oneRowAge.Item(11)))
  160.                     .Parameters.Add(New OleDbParameter("Truck", oneRowAge.Item(10)))
  161.                     .Parameters.Add(New OleDbParameter("Time", oneRowAge.Item(9)))
  162.                     .Parameters.Add(New OleDbParameter("Juice", oneRowAge.Item(19)))
  163.                     .Parameters.Add(New OleDbParameter("ReceiptID", uniID))
  164.                     Dim fs As IO.FileStream = New IO.FileStream("C:\testpre\Signature\Agency\" & uniID & ".bmp", IO.FileMode.Create)
  165.                     fs.Write(oneRowAge.Item(12), 0, oneRowAge.Item(12).Length)
  166.                     fs.Flush()
  167.                     fs.Close()
  168.                     .Connection = FHDB ' connection string
  169.                     .Connection.Open() ' open connection
  170.                     .ExecuteNonQuery() ' execute command
  171.                     .Connection.Close() ' close connection
  172.                     .Dispose() ' free memory
  173.                 End With
  174.                 For linkRowNum As Integer = 0 To DonorChanges.Tables(2).Rows.Count - 1
  175.                     If DonorChanges.Tables(2).Rows(linkRowNum).Item(0).Equals(oneRowAge.Item(23).ToString) Then
  176.                         DonorChanges.Tables(2).Rows(linkRowNum).Item(0) = uniID
  177.                     End If
  178.                 Next
  179.             End If
  180.         Next
  181.         Dim rowsInventory As Integer = DonorChanges.Tables(3).Rows.Count
  182.  
  183.         For rowscount As Integer = 1 To rowsInventory
  184.             Dim addInventoryRec As New OleDb.OleDbCommand
  185.             Dim oneRowInv As DataRow = DonorChanges.Tables(3).Rows.Item((rowscount - 1))
  186.             DonorStartingRows = DonorStartingRows + 1
  187.             With addInventoryRec
  188.                 .CommandTimeout = 600000
  189.                 .CommandText = "insert into tblFoodDonations ([Date], [Donor Time], [Bakery], [Meat]," & _
  190.                     "[Fruit], [Dairy], [Vegetable], [Prepared], [Juice], [Non-Perishable], [Non-Food]," & _
  191.                     "[Total Donations], [DonorReceiptId], Driver, TruckNumber, DonorID, FoodDonationsID, Description, InventoryTypeId)" & _
  192.                     "values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
  193.                 .Parameters.Add(New OleDbParameter("Date", oneRowInv.Item(10).Date))
  194.                 .Parameters.Add(New OleDbParameter("Time", oneRowInv.Item(11)))
  195.                 .Parameters.Add(New OleDbParameter("Bakery", oneRowInv.Item(1)))
  196.                 .Parameters.Add(New OleDbParameter("Meat", oneRowInv.Item(3)))
  197.                 .Parameters.Add(New OleDbParameter("Fruit", oneRowInv.Item(4)))
  198.                 .Parameters.Add(New OleDbParameter("Dairy", oneRowInv.Item(2)))
  199.                 .Parameters.Add(New OleDbParameter("Vege", oneRowInv.Item(5)))
  200.                 .Parameters.Add(New OleDbParameter("Prep", oneRowInv.Item(6)))
  201.                 .Parameters.Add(New OleDbParameter("Juice", oneRowInv.Item(7)))
  202.                 .Parameters.Add(New OleDbParameter("NP", oneRowInv.Item(8)))
  203.                 .Parameters.Add(New OleDbParameter("NF", oneRowInv.Item(9)))
  204.                 .Parameters.Add(New OleDbParameter("Total", oneRowInv.Item(23)))
  205.                 .Parameters.Add(New OleDbParameter("ReceiptID", oneRowInv.Item(0)))
  206.                 .Parameters.Add(New OleDbParameter("Driver", oneRowInv.Item(12)))
  207.                 .Parameters.Add(New OleDbParameter("Truck", oneRowInv.Item(13)))
  208.                 .Parameters.Add(New OleDbParameter("DonorID", oneRowInv.Item(24)))
  209.                 .Parameters.Add(New OleDbParameter("FoodID", oneRowInv.Item(0)))
  210.                 .Parameters.Add(New OleDbParameter("Description", oneRowInv.Item(25)))
  211.                 .Parameters.Add(New OleDbParameter("InvTypeID", 1))
  212.                 .Connection = FHDB ' connection string
  213.                 .Connection.Open() ' open connection
  214.                 .ExecuteNonQuery() ' execute command
  215.                 .Connection.Close() ' close connection
  216.                 .Dispose() ' free memory
  217.             End With
  218.         Next
  219.  
  220.         Dim daLink As New OleDb.OleDbDataAdapter("select * from tblAgencyDonationLink", FHDB)
  221.         Dim LinkTable As New DataTable
  222.         daLink.Fill(LinkTable)
  223.  
  224.         LinkStartingRows = LinkTable.Rows.Count
  225.         daLink.Dispose()
  226.         LinkTable.Dispose()
  227.  
  228.         Dim rowsLink As Integer = DonorChanges.Tables(2).Rows.Count
  229.  
  230.         For rowscount As Integer = 1 To rowsLink
  231.             Dim addLinkRec As New OleDb.OleDbCommand ' Declare new command
  232.             Dim oneRowLink As DataRow = DonorChanges.Tables(2).Rows.Item((rowscount - 1)) ' The row to be inserted
  233.             With addLinkRec
  234.                 .CommandTimeout = 600000
  235.                 'insert command
  236.                 .CommandText = "insert into tblAgencyDonationLink (ReceiptID, FoodDonationsID, Bakery, Dairy, Meat," _
  237.                 & "Fruit, Vegetable, Prepared, Beverage, [Non-Perishable], [Non-Food], DateEntered, DistributionDate)" _
  238.                 & "values (?,?,?,?,?,?,?,?,?,?,?,?,?)"
  239.                 .Parameters.Add(New OleDbParameter("ReceiptID", oneRowLink.Item(0)))
  240.                 .Parameters.Add(New OleDbParameter("FoodID", oneRowLink.Item(1)))
  241.                 .Parameters.Add(New OleDbParameter("Bakery", oneRowLink.Item(2)))
  242.                 .Parameters.Add(New OleDbParameter("Dairy", oneRowLink.Item(3)))
  243.                 .Parameters.Add(New OleDbParameter("Meat", oneRowLink.Item(4)))
  244.                 .Parameters.Add(New OleDbParameter("Fruit", oneRowLink.Item(5)))
  245.                 .Parameters.Add(New OleDbParameter("Vege", oneRowLink.Item(6)))
  246.                 .Parameters.Add(New OleDbParameter("Prep", oneRowLink.Item(7)))
  247.                 .Parameters.Add(New OleDbParameter("Bev", oneRowLink.Item(8)))
  248.                 .Parameters.Add(New OleDbParameter("NP", oneRowLink.Item(9)))
  249.                 .Parameters.Add(New OleDbParameter("NF", oneRowLink.Item(10)))
  250.                 .Parameters.Add(New OleDbParameter("DateEnt", DateTime.Today))
  251.                 .Parameters.Add(New OleDbParameter("DistDate", oneRowLink.Item(11)))
  252.                 .Connection = FHDB ' connection string
  253.                 .Connection.Open() ' open connection
  254.                 .ExecuteNonQuery() ' execute command
  255.                 .Connection.Close() ' close connection
  256.                 .Dispose() ' free memory
  257.             End With
  258.         Next
  259.  
  260.         FHDB.Dispose() ' No longer need the sting free the memory
  261.         ' If all the rows were send return true else thor exeption to catch
  262.         If EndOfTables(DonorStartingRows, AgencyStartingRows, LinkStartingRows, DonorChanges) Then
  263.             Return True
  264.         Else
  265.             Throw New ArithmeticException
  266.         End If
  267.  
  268.     End Function
  269.  
  270.     <System.Web.Services.WebMethod()> _
  271.     Public Function EndOfTables(ByVal DonorStartingRows As Integer, ByVal AgencyStartingRows As Integer, ByVal LinkStartingRows As Integer, ByVal DonorChanges As DataSet) As Boolean
  272.         Me.Server.ScriptTimeout = 600000
  273.         ' Connection string to connect to access database
  274.         Dim FHDB As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\testpre\Replica_of_be\Replica_of_harvest2000_be.mdb;User Id=admin;Password=;")
  275.  
  276.         ' Table adapter to get information from tables in the database
  277.         Dim daFoodDonor As New OleDb.OleDbDataAdapter("select * from tblFoodDonations", FHDB)
  278.         Dim daAgencyRec As New OleDb.OleDbDataAdapter("select * from tblAgencyReceipt", FHDB)
  279.         Dim daLink As New OleDb.OleDbDataAdapter("select * from tblAgencyDonationLink", FHDB)
  280.         ' Data table to store info
  281.         Dim FoodDonorTable As New DataTable
  282.         Dim AgencyRecTable As New DataTable
  283.         Dim LinkTable As New DataTable
  284.         ' Fill the data table with info
  285.         daFoodDonor.Fill(FoodDonorTable)
  286.         daAgencyRec.Fill(AgencyRecTable)
  287.         daLink.Fill(LinkTable)
  288.         ' Free some memory
  289.         daFoodDonor.Dispose()
  290.         daAgencyRec.Dispose()
  291.         daLink.Dispose()
  292.         ' The number of rows that is supposed to be sent
  293.         Dim DonorTargetRows As Integer = DonorChanges.Tables(0).Rows.Count
  294.         Dim AgencyTargetRows As Integer = DonorChanges.Tables(1).Rows.Count
  295.         Dim LinkTargetRows As Integer = DonorChanges.Tables(2).Rows.Count
  296.         ' free some memory
  297.         DonorChanges.Dispose()
  298.         ' The total number of rows after data has been sent
  299.         Dim DonorEndingRows As Integer = FoodDonorTable.Rows.Count
  300.         Dim AgencyEndingRows As Integer = AgencyRecTable.Rows.Count
  301.         Dim LinkEndingRows As Integer = LinkTable.Rows.Count
  302.         ' free some memory
  303.         FoodDonorTable.Dispose()
  304.         AgencyRecTable.Dispose()
  305.         LinkTable.Dispose()
  306.         ' The number of rows sent
  307.         Dim DonorRows As Integer = DonorEndingRows - DonorStartingRows
  308.         Dim AgencyRows As Integer = AgencyEndingRows - AgencyStartingRows
  309.         Dim LinkRows As Integer = LinkEndingRows - LinkStartingRows
  310.         ' If everything equals return true if not return false
  311.         If DonorRows.Equals(DonorTargetRows) And _
  312.            AgencyRows.Equals(AgencyTargetRows) And _
  313.            LinkRows.Equals(LinkTargetRows) Then
  314.             Return True
  315.         Else
  316.             Return False
  317.         End If
  318.     End Function
  319.  
  320. End Class
  321.  
Web.config
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0"?>
  2. <!-- 
  3.     Note: As an alternative to hand editing this file you can use the 
  4.     web admin tool to configure settings for your application. Use
  5.     the Website->Asp.Net Configuration option in Visual Studio.
  6.     A full list of settings and comments can be found in 
  7.     machine.config.comments usually located in 
  8.     \Windows\Microsoft.Net\Framework\v2.x\Config 
  9. -->
  10. <configuration>
  11.   <appSettings/>
  12.     <connectionStrings/>
  13.   <location allowOverride="true">
  14.     <system.web>
  15.       <securityPolicy>
  16.         <trustLevel name="Full" policyFile="internal" />
  17.         <trustLevel name="High" policyFile="web_hightrust.config" />
  18.         <trustLevel name="Medium" policyFile="web_mediumtrust.config" />
  19.         <trustLevel name="Low"  policyFile="web_lowtrust.config" />
  20.         <trustLevel name="Minimal" policyFile="web_minimaltrust.config" />
  21.         <trustLevel name="ModifiedMedium" policyFile="modified_mediumtrust.config"/>
  22.       </securityPolicy>
  23.         <trust level="Full" originUrl="" />
  24.  
  25.       <!--<identity impersonate="true" username="STUDENT" password="food"/>-->
  26.       <!-- 
  27.             Set compilation debug="true" to insert debugging 
  28.             symbols into the compiled page. Because this 
  29.             affects performance, set this value to true only 
  30.             during development.
  31.  
  32.             Visual Basic options:
  33.             Set strict="true" to disallow all data type conversions 
  34.             where data loss can occur. 
  35.             Set explicit="true" to force declaration of all variables.
  36.         -->
  37.       <compilation debug="true" strict="false" explicit="true"/>
  38.       <pages>
  39.         <namespaces>
  40.           <clear/>
  41.           <add namespace="System"/>
  42.           <add namespace="System.Collections"/>
  43.           <add namespace="System.Collections.Specialized"/>
  44.           <add namespace="System.Configuration"/>
  45.           <add namespace="System.Text"/>
  46.           <add namespace="System.Text.RegularExpressions"/>
  47.           <add namespace="System.Web"/>
  48.           <add namespace="System.Web.Caching"/>
  49.           <add namespace="System.Web.SessionState"/>
  50.           <add namespace="System.Web.Security"/>
  51.           <add namespace="System.Web.Profile"/>
  52.           <add namespace="System.Web.UI"/>
  53.           <add namespace="System.Web.UI.WebControls"/>
  54.           <add namespace="System.Web.UI.WebControls.WebParts"/>
  55.           <add namespace="System.Web.UI.HtmlControls"/>
  56.  
  57.         </namespaces>
  58.       </pages>
  59.       <httpRuntime minFreeThreads="88" minLocalRequestFreeThreads="76" executionTimeout="600000" maxRequestLength="10000"/>
  60.       <!--
  61.             The <authentication> section enables configuration 
  62.             of the security authentication mode used by 
  63.             ASP.NET to identify an incoming user. 
  64.         -->
  65.  
  66.       <authentication mode="Windows"/>
  67.  
  68.  
  69.  
  70.       <!--
  71.             The <customErrors> section enables configuration 
  72.             of what to do if/when an unhandled error occurs 
  73.             during the execution of a request. Specifically, 
  74.             it enables developers to configure html error pages 
  75.             to be displayed in place of a error stack trace.
  76.  
  77.         <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
  78.             <error statusCode="403" redirect="NoAccess.htm" />
  79.             <error statusCode="404" redirect="FileNotFound.htm" />
  80.         </customErrors>
  81.         -->
  82.  
  83.     </system.web>
  84.  
  85.   </location>  
  86. </configuration>
  87.  
Aug 30 '07 #3
Cintury
81
Hi all,

I've developed a mobile application for windows mobile 5.0 that has
been in use for a while (1 year and a couple of months). It was
developed in visual studios 2005 with a back-end sql server mobile ce
database. Until recently I was synching everything thru a com port
serial cable. The devices would connect to the computer thru
activesync and are able to acquire an internet connection. The sync
for the program occurs thru a website stored locally on my computer
that then places the data in a local Access database.

As I said this has all been working fine, however at the beginning of
the week our server crashed and since its been repaired everytime I
try to upload the data I get Upload Failure: unable to read data from
the transport connection.

Now two of the mobile devices will still upload data intermittenly out
of 16. I've checked the settings on the devices and they are all the
same. They can all access the internet thru pocket explorer when
connected to the computer via the cable. I've checked my code and the
connection timeout is set to 600000 seconds. Please ,please help me
with this issue as I really have a backlog of data piling up on me.

Thank you!
Aug 31 '07 #4
Cintury
81
Web.config file
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0"?>
  2. <!-- 
  3.     Note: As an alternative to hand editing this file you can use the 
  4.     web admin tool to configure settings for your application. Use
  5.     the Website->Asp.Net Configuration option in Visual Studio.
  6.     A full list of settings and comments can be found in 
  7.     machine.config.comments usually located in 
  8.     \Windows\Microsoft.Net\Framework\v2.x\Config 
  9. -->
  10. <configuration>
  11.     <appSettings/>
  12.     <connectionStrings/>
  13.     <location allowOverride="true">
  14.         <system.web>
  15.             <securityPolicy>
  16.                 <trustLevel name="Full" policyFile="internal"/>
  17.                 <trustLevel name="High" policyFile="web_hightrust.config"/>
  18.                 <trustLevel name="Medium" policyFile="web_mediumtrust.config"/>
  19.                 <trustLevel name="Low" policyFile="web_lowtrust.config"/>
  20.                 <trustLevel name="Minimal" policyFile="web_minimaltrust.config"/>
  21.                 <trustLevel name="ModifiedMedium" policyFile="modified_mediumtrust.config"/>
  22.             </securityPolicy>
  23.             <trust level="Full" originUrl=""/>
  24.             <!--<identity impersonate="true" username="STUDENT" password="food"/>-->
  25.             <!-- 
  26.             Set compilation debug="true" to insert debugging 
  27.             symbols into the compiled page. Because this 
  28.             affects performance, set this value to true only 
  29.             during development.
  30.  
  31.             Visual Basic options:
  32.             Set strict="true" to disallow all data type conversions 
  33.             where data loss can occur. 
  34.             Set explicit="true" to force declaration of all variables.
  35.         -->
  36.       <compilation debug="true" strict="false" explicit="true">
  37.  
  38.         <assemblies>
  39.           <add assembly="Microsoft.Data.Odbc, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
  40.           <add assembly="Microsoft.SqlServer.SqlCEDest, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
  41.         </assemblies>
  42.       </compilation>
  43.  
  44.  
Aug 31 '07 #5
Cintury
81
Web.config continued
Expand|Select|Wrap|Line Numbers
  1. <pages>
  2.                 <namespaces>
  3.                     <clear/>
  4.                     <add namespace="System"/>
  5.                     <add namespace="System.Collections"/>
  6.                     <add namespace="System.Collections.Specialized"/>
  7.                     <add namespace="System.Configuration"/>
  8.                     <add namespace="System.Text"/>
  9.                     <add namespace="System.Text.RegularExpressions"/>
  10.                     <add namespace="System.Web"/>
  11.                     <add namespace="System.Web.Caching"/>
  12.                     <add namespace="System.Web.SessionState"/>
  13.                     <add namespace="System.Web.Security"/>
  14.                     <add namespace="System.Web.Profile"/>
  15.                     <add namespace="System.Web.UI"/>
  16.                     <add namespace="System.Web.UI.WebControls"/>
  17.                     <add namespace="System.Web.UI.WebControls.WebParts"/>
  18.                     <add namespace="System.Web.UI.HtmlControls"/>
  19.                 </namespaces>
  20.             </pages>
  21.             <httpRuntime minFreeThreads="88" minLocalRequestFreeThreads="76" executionTimeout="600000" maxRequestLength="10000"/>
  22.             <!--
  23.             The <authentication> section enables configuration 
  24.             of the security authentication mode used by 
  25.             ASP.NET to identify an incoming user. 
  26.         -->
  27.             <authentication mode="Windows"/>
  28.             <!--
  29.             The <customErrors> section enables configuration 
  30.             of what to do if/when an unhandled error occurs 
  31.             during the execution of a request. Specifically, 
  32.             it enables developers to configure html error pages 
  33.             to be displayed in place of a error stack trace.
  34.  
  35.         <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
  36.             <error statusCode="403" redirect="NoAccess.htm" />
  37.             <error statusCode="404" redirect="FileNotFound.htm" />
  38.         </customErrors>
  39.         -->
  40.         </system.web>
  41.     </location>
  42.     <system.web>
  43.         <customErrors defaultRedirect=""/>
  44.         <trace enabled="true" localOnly="false" mostRecent="true" pageOutput="true"/>    
  45.             </system.web>
  46. </configuration>
  47.  
Aug 31 '07 #6
Cintury
81
The Computer that was hosting the transfer website had its IP address changed and that caused the connection not to work. So I simply changed the website url in the app files and its good to go.
Sep 11 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Mike Dole | last post by:
I'm working on a client - server application based on the 'How to Sockets Server and How to Sockets Client' code from the Visual Basic ..NET Resource Kit. Since I want to be able to send 'big...
0
by: Steve - DND | last post by:
We are continually receiving timeout, and "Unable to write data to the transport connection" errors while using the System.Net.HttpWebRequest class from an ASP.Net web page. Below are the two...
1
by: Muscha | last post by:
Hello, Every now and then my application throw this exception: "Unable to read data from the transport connection" And when I break into the Visual Studio, the thread where it failed has...
0
by: Aryeh Holzer | last post by:
Hi, I've been trying to use the weather webservice available from the National Weather Service (NWS), at http://www.nws.noaa.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML. wsdl without success. Here's...
0
by: Arno | last post by:
Hi, I've written a class for client-socket connection, but I get a lot of times the error message "Unable to read data from the transport connection" when restart reading the stream with...
1
by: Terrance | last post by:
I'm trying to create a small messenger program that uses the tcpclient and tcplistenter objects. When I start the application and run the thread that fires the tcplistener; once the client sends...
0
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted...
3
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted...
7
by: Jay Balapa | last post by:
Hello, We have a Pocket PC client application which just connects to our webservice. When a client connects his Pocket PC through his WIFI he gets the following- Unable to read data from the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.