By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,426 Members | 3,118 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,426 IT Pros & Developers. It's quick & easy.

Unable to read data from the transport Connection

Cintury
P: 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
Share this Question
Share on Google+
6 Replies


Cintury
P: 81
test test test test test
Aug 30 '07 #2

Cintury
P: 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
P: 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
P: 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
P: 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
P: 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

Post your reply

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