Jump to content
Xtreme .Net Talk

hog

Avatar/Signature
  • Posts

    1011
  • Joined

  • Last visited

Everything posted by hog

  1. Firstly doh.....should have posted this under FileIO..... OK searching further into this site I found this link: http://msdn.microsoft.com/library/d...adlinetopic.asp Which allows me to read in a complete line(record) from my tab separated file but do I really have to write some code to cycle through this string to locate each tab and thus each field? Is there not a way/method built into VB.NET to read tab files?
  2. Can anyone give me a few pointers as to the best way to read a tab seperated text file so that I can access each field individually? The only bumf I have on reading files details creating classes as <Serializable()> which is muddying the water. Also I'm getting confused with all this StreamReader, FileStream, File etc??
  3. My two cents is this: For my current role if someone were to apply for my job they would need a pro qual something like MCAD and or 3-4 year experience. I have absolutely no quals at all but have worked in programming since 1992 so have a lot of experince in programming for my current employer. I like the idea of getting a proper qualification but at 40......not sure I can be arsed :)
  4. My copy works perfectly fine, although I did get a lot of trouble when first installing 2003. To resolve this I completely removed 2002 and then installed 2003 and all my problems went away.
  5. So another problem arises.... My code above is fine, (allbeit ugly), to read and write a single field from a text file that contains just one field per line. But how would I go about getting the data from a file that has 7 tab seperated fields, all of which could contain varying lenghs of data????
  6. OK so I have found a way to close the extrenal app by using the process object. But this object doesn't have a minimize method!
  7. lol:):)
  8. I have an application that starts an external app to allow the user to interact with to obtain various data output. At a certain point I want to minimize this external app and return focus to the main app. Then at another point restore the external app for more output. Basically I'm just trying to automate things to make life easier for the user. Is this possible in VB.NET:?
  9. Check your data you are trying to put in the field. Somewhere an item is too large
  10. lstListBox.Clear lstListBox.Items.Add(your item)
  11. You can put your code in seperate classes or module files and simply add them to your project
  12. Try MyVar = drRow.item("fieldname")
  13. Ah OK cheers I'll check out the ToString() approach:) As for Paul Zaloom and Beakman's World? I don't think this show has made it to the UK so don't know him.......but he looks bloody funny lol:)
  14. man I's jus gotta say I lus your avitar....I can't stop laughin lol:) Yep I recoded to use the filewatcher so no more hoggin :)
  15. just love ya avitar:):):) Much more elegant, but doesn't the need to cycle trough the array to load it into the dataset make it sloppy again:(
  16. Well I got it to work.......but this code is UGLY MAN just plain UGLY!! Surely there is a more elegant way?? Dim fFile1 As FileStream = File.Open(Environment.GetFolderPath(Environment.SpecialFolder.Personal) & "\p1.txt", _ FileMode.Open, FileAccess.Read) Dim bfBuffer As UTF8Encoding = New UTF8Encoding(True) Dim arrBytes(9) As Byte strSQL = "SELECT * FROM tblPersonelID1 WHERE tblPersonelID1.pi = 'NOTHING'" odaPILists = New System.Data.OleDb.OleDbDataAdapter(strSQL, objConn) odaPILists.Fill(dtPILists) ocbPILists = New System.Data.OleDb.OleDbCommandBuilder(odaPILists) Try Do While fFile1.Read(arrBytes, 0, arrBytes.Length) > 0 drPILists = dtPILists.NewRow() drPILists.BeginEdit() drPILists.Item("PI") = bfBuffer.GetString(arrBytes) drPILists.EndEdit() dtPILists.Rows.Add(drPILists) odaPILists.InsertCommand = ocbPILists.GetInsertCommand odaPILists.Update(dtPILists) dtPILists.AcceptChanges() Loop Catch objException As Exception ShowError("Location: Class ImportData" & ControlChars.CrLf & ControlChars.CrLf & "Procedure: " & _ "cmdGenerate(ByVal strSuppliername As String)" & ControlChars.CrLf & ControlChars.CrLf & "Error Text: " & _ objException.Message) End Try
  17. What is the best way to get a text file into Access via VB.NET? Do I use a streamreader to read the file into a dataset then into Access or is there a method to whack it straight in Access? Ta
  18. I always use IsNumeric() although others may say to use something else... If Not IsNumeric(text goes here) Then End if
  19. Okey dokey thanks chaps, I'll give it a whirl. I did get my code to work eventually like this.......I take it is is less efficient than the filewatcher? Do While True ' let the computer carry on with background events Application.DoEvents() ' check for files and if they exist update the screen fFile1 = New FileInfo(strFileP1) If fFile1.Exists Then Me.chkP1Detected.Checked = True End If fFile2 = New FileInfo(strFileP2) If fFile2.Exists Then Me.chkP2Detected.Checked = True End If ' if both files exist enable button to allow user to generate p3.txt interface file ' and jump out of loop If Me.chkP1Detected.Checked And Me.chkP2Detected.Checked Then Me.cmdGenerateP3.Enabled = True Exit Do End If Loop ps congratulations on the twins:):)
  20. I have an app that I want to sit and wait for two files that are being created from another application. When these files are detected I want the screen to be updated and a button enabled to allow further processing of these two require files. This is what I'm attempting but with little success: Do While True Application.DoEvents() ' if file one exists update screen ' if file two exist update screen ' if both files exits enable button and jump out of loop Loop Is this something that I should be using a Thread on? Bear in mind I haven't used threads before which is why for something so simple I'm using the DoEvents method:)
  21. FileInfo.Length returns the file size
  22. Pete, you make me laugh.....you just gotta have the last word! Go on then I'll let ya:):):)
  23. type streamwriter then position your cursor on the text and press F1, or type streamwriter in the serch help dialog:)
  24. Pete, I accept your opinion on the topic but you must also accept other have a perfectly valid opinion also. Orbity......well said :)
  25. yep, but I just the code for this book is not there! I have since been contacted by the publishere Apres who now own the rights to the book and have pointed me to the area on their site which had the source:)
×
×
  • Create New...