Jump to content
Xtreme .Net Talk

hog

Avatar/Signature
  • Posts

    1011
  • Joined

  • Last visited

Everything posted by hog

  1. Just to hook onto this thread.... The MSDN should this be available within the VS IDE?
  2. Does anyone know if it is possible to set the text display of a DateTimePicker control to nothing? I have 7 of these controls which get set depending on what data is received back from the database. If only 1 date is received then the the corresponding DateTimePicker is set to this date and the rest have the default value displayed. Is there no way to force the control to be blank until a date is received or one is chosen?
  3. DOH!!!!! Can u all hear that penny drop:):):) Thnx Robby:)
  4. OK I'm obviously missing something really basic here:( This is how I populate my combobox. Dim strSQL As String = "SELECT '[' + str(CandidateID) + ']' + ' ' + LastName + ' ' + FirstName AS " & _ "FullName, LastName + ' ' + FirstName AS SortName " & _ "FROM tblCandidates ORDER BY LastName + ' ' + FirstName" While odrReader.Read() Me.cboFullName.Items.Add(odrReader.GetString(0)) End While I've omitted all the other code for clarity. 1. How do I add multiple columns? 2. I only have this problem cos I read that a datareader was better used in this read only situation as opposed to a dataadapter? I always used dataadapters before and so never had this problem?? 3. Wryd, are you saying I should inherit a combobox control and modify it some how? cheers:)
  5. Robby, my combo boxes do not hve properties datavaluefield or datatext field? Thnx _SBradley_ I'll have to read up on regx as the Regex("\[(?<id>([0-9]+))\]" entry seems odd:)
  6. Right I know this is overly complicated but I couldn't figure out how to get the ID value. If I used a datasource, displaymember,value member approach this would be easy. But I am building the combobox values on the fly. I don't know how to add multiple columns to a combobox and then how to retrieve a particular column. Although I'm off to have a look now :)
  7. This looks impressive, but I don't understand it:( Can anyone put it into VB??
  8. OK thnx I'll look at this:) The string in the combobox is a concatenation of database fields id, lastname and first name. I'm doing it this way to extract the id from the string. I build the combobox using the add items method but couldn't figure out how to include the id field after the concatenation and be able to return this as the users choice if you know what I mean??
  9. Right I have a combo box which has entries like thie; [3] DOE JOHN I want to use spilt to extract the 3. My code below when using the combobox selecteditem method gives me a blank message box, but if I hard code the text I get the 3? Am I missing something here? Dim strString As String = Me.cboFullName.SelectedItem 'Dim strString As String = "[3] DOE JOHN" Dim strDelimiterList As String = "[] " Dim strDelimiter As Char() = strDelimiterList.ToCharArray() Dim strSplit As String() = Nothing strSplit = strString.Split(strDelimiter, 3) MessageBox.Show(strSplit(1))
  10. Sorry Bucky, just going through the site I see I never posted back to say your suggestion worked a treat :)
  11. Have you thought of using the InStr function to check for the existence of brackets first?
  12. Try this, set the datasource, displaymember and valuemember properties of your combo box then do something like this; Me.DataSetWhatever.Clear() Me.OleDbAdapterWhatever.Fill(Me.DataSetWhatever)
  13. OK so coding to loop through the data reader to populate the combo box is the way to go:) Thnx
  14. To date I have always used a DataAdapter to populate a Combo Box simply by calling the Fill method. As the Combo Box has its DataSource etc set to the DataAdapter it gets refreshed with little effort on my part. I am reading that a DataReader is much quicker and efficient for getting read only data, which is what I am doing. Question is this; do I have to loop through the returned records and add each indiviual record to the Combo Box or is there an automatic way that VB.Net manages? Thnx
  15. could anyone explain why based on the following I get both elements returned when I only want to return the path element?? <?xml version="1.0" encoding="utf-8" ?> <!ELEMENT config (path, sysadmin)> <!ELEMENT path (#PCDATA)> <!ELEMENT sysadmin (#PCDATA)> <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE Config PUBLIC "SYSTEM" "xConfig-DTD.xml"> <Config> <path>C:\Documents and Settings\paul\My Documents\project.mdb</path> <sysadmin>d.p.hooper</sysadmin> </Config> Try Dim strDocument As String = Environment.GetFolderPath(Environment.SpecialFolder.System) & "\xConfig.xml" Dim xPathDocument As XPathDocument = New XPathDocument(strDocument) Dim xPathNav As XPathNavigator = xPathDocument.CreateNavigator xPathNav.MoveToRoot() Dim xPathNodeIterate As XPathNodeIterator = xPathNav.Select("descendant::config/path") xPathNodeIterate.MoveNext() strPath = xPathNodeIterate.Current.Value Catch objException As Exception ShowError("Location: Class frmMain" & ControlChars.CrLf & ControlChars.CrLf & _ "Procedure: SetUserPref" & ControlChars.CrLf & ControlChars.CrLf & "Error Text: " & _ objException.Message) Return False End Try
  16. In your timer event code do something like: If picture1.picture = "image1" then picture1.picture = "image2" else picture1.picture = "image1" end if
  17. I now know that to solve my current problem I need to use transactions to ensure integrity. I have to date only used Access2002 as my datasource which I have read I need to use in conjunction with SQL Server to make use of transactions. Alas I do not have access to SQL Server but I do I think have access to MSDE. Question is this, is it possible to create a transaction setup using MSDE and also how do I actually go about creating a MSDE database? Where is the interface to which I would do this?? Thnx for any advice
  18. hog

    Objects how to.

    Ok thanks, that makes sense but what of the save problem? Say saveA and saveB go ok but saveC gets refused due to conflict. Would I need to use some form of transaction method and if so is this something I need to create manually to ensure integrity throughout A,B and C.
  19. I hope I can explain this so as to make it clear what I'm trying to get my head around? Lets say I have three objects, A, B & C all of which get their data from three different tables, tblA, tblB & tblC. Right so now I need to create an end object that inherits all 3. So A inherits B which inherits C and finally D inherits A. I therefore endup with an object which can be populated with data from 3 different tables. What I'm trying to get my head around is this. Say I want to save changes using the D objects Save method which will need to save the changes to tblA, tblB and tblC respectively. What happens if when the save gets to tblC and the concurrency stops the update as some other user beat me to it? This will stop an invalid update to tblC but tblA and tblB would have already been updated? Does this make sense? Please ask for more clarification if require:(?
  20. I started when I was 21 on a ZX81 :)
  21. If you already have the resource cd from the VS suite all you need is to obtain the licence via email to unlock the componentone stuff on the CD
  22. iif(expression,true result, false result) myvar = iif(1 > 2, "yes", "no") myvar will equal "no"
  23. Regarding problem 3 this was a bug in VS 2002, not sure if they fixed it in VS 2003. What you are doing is the way to fix it.
  24. SAMS Teach Yourself VB.NET in 21 Days
  25. Thanks Jahatziel. I too fell into this keycodev2.dll trap but after reading your post here it is resolved :):):)
×
×
  • Create New...