Search results for query: *

  1. J

    DataView

    Thanks Jmc, I read up and it's easy when you know how eh, got it working using this: Dim table As DataTable = ds.Tables("dbServD") Dim foundRows() As DataRow Dim iRoute As String = Mid(LineText, 9, 4) iRoute = iRoute.TrimStart("0c")...
  2. J

    DataView

    OK, So a sample from the file is: 1 !126!0044!XL!0044!1015!1018!06/27 10:21:37! 39 !"X" I use streamreader to pull a line, then i get the route number by using MID which gives me 0044, i then trim all leading 0's to leave me 44. I then need to check this value is in the database in a...
  3. J

    DataView

    Hi Jmc, Thanks, i'm not sure how i implement this in my code, once i have read a line of my file i jump in to my CheckRoute sub a follows: Private Sub CheckRoute() Try Dim iRoute As String = Mid(LineText, 9, 4) iRoute = iRoute.TrimStart("0c")...
  4. J

    DataView

    no the first 4 characters could be space,1,1,1 or space,1,1,space. i'm using linetext as this is the file i'm comparing to the database, it goes through each line in the file and checks to see if the value exists in the databasetable which is stored in my dataset. the dv.find just returns the...
  5. J

    DataView

    sorry, The SQL table has a column called route, in this are a number of routes with letter/s after the number (" 42 AA", " 42 AB", " 101 EL", etc). I have the route as just the integer so 42, so i need to look for the first 4 characters of the column route as these are always the integers and...
  6. J

    DataView

    Hi, Im trying to write a program that pulls in 3 tables from SQL Server and then checks those tables for specific values. the code below is working when i try to find an operator in the operators table: Dim dv As DataView Dim iOp As String = Mid(LineText, 5, 3)...
  7. J

    How to create an array of bytes?

    Can you please explain why 0x is replaced with the &H?
  8. J

    How to create an array of bytes?

    Thank you very much
  9. J

    How to create an array of bytes?

    I have a bluetooth pen that I need to send an array of bytes too, can somebody offer advice on how i create an array of bytes for the following:0x68 0x00 0x02 0xFF 0x0A (in the guide this is the array of bytes I need to send)Thanks.
  10. J

    Question Problem with DataGrid

    It is deleting from the dataset but If Me.myView.CurrentPosition > -1 Then Dim row = CType(Me.myView.CurrentItem, DataRowView) row.Delete() looks like an issue as i'm always getting CurrentPosition equals 0 no matter what line in the datagrid i press on so it always deletes row 0. I think...
  11. J

    Question Problem with DataGrid

    I don't have Me.customeradapter.close I tried the below in the Save button. Me.customeradapter.Connection.Close() But I still get the error, it then deletes the record but when I close and re-open the form the record is still there.
  12. J

    Question Problem with DataGrid

    I have added a DataGrid to my form and it seems to be working well apart from when I add a row, save the changes and then attempt to delete a row, i get a Concurrency Violation with the DeleteCommand. Any help would be much appreciated. My Code: Imports System.Data Public Class Window2...
  13. J

    Delete a record from a datasource

    That's exactly it, thanks for helping out, much appreciated.
  14. J

    Delete a record from a datasource

    In my dataset designer the INSERT CommandText had been populated with INSERT INTO Purchase_Orders (Order_Reference, Date_Placed, Date_Delivered, Customer_Name, Customer_Address, Customer_Tel, Customer_Email, Product, Amount) VALUES (@p1,@p2,@p3,@p4,@p5,@p6,@p7,@p8,@p9)...
  15. J

    Delete a record from a datasource

    OK I've got it. I hadn't selected a DeleteCommand in the dataset designer and then I just needed to set the CommandText statement to DELETE FROM Purchase_Orders WHERE (Order_Number = @Order_Number) Thanks for pointing me in the right direction, have tested and all seems to be working well now.
  16. J

    Delete a record from a datasource

    I have a Fill,GetData() and it's SQL is I presume i need a delete command in there, but if that's the case why does the insert a new record work without there being an INSERT command in the dataset?
  17. J

    Delete a record from a datasource

    I have tried this and then i get the 'Update requires a valid DeleteCommand when passed DataRow collection with deleted rows.' I try and use something like Dim cb As New SqlCeCommandBuilder(Me.customeradapter) but obviously my dataadapter hasn't been defined as sqlce so it wont work.
  18. J

    Delete a record from a datasource

    I have a sample database that I am able to navigate, add new and update but I am falling over when it comes to deleting a record. Currently the user would navigate the record and then select delete, I have this code which seems to delete it from the view but when i re-load the form it is there...
  19. J

    Query Help

    Hi, I am new to SQL queries and was after some help. I have a database with fields ID, Line, StationName, StationNumber and Variant. I need to: Find the line and station from the database (from selections made from user) This will show what variants the station has attached to it. I then...
  20. J

    Saving to SQL, data is not there

    Thanks, that's exactly what it was. It was updating the database in the location on the mobile device yet I was querying the database stored locally. Silly mistake. Thanks again.
Back
Top