Jump to content
Xtreme .Net Talk

penfold69

Avatar/Signature
  • Posts

    135
  • Joined

  • Last visited

Everything posted by penfold69

  1. As a starting point, do something like: Private Sub myGrid_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles myGrid.MouseMove Dim hti As DataGrid.HitTestInfo = myGrid.HitTest(e.X, e.Y) If hti.Type = DataGrid.HitTestType.Cell Then myGrid.Select(hti.Row) End If End Sub B.
  2. Yes, you need to set the appropriate width in the TableStyle to 0. If you are allowing the DataGrid to create the TableStyle manually, then after you set the Datasource of the datagrid, do: datagrid.TableStyles(0).GridColumnStyles(YourColumnIndex).Width = 0 This will make the width of the column 0, and therefore not visible. If you are creating the tablestyle yourself, simply include the relevant columns in the tablestyle that you wish to display. Any other columsn in the datatable/dataset that are not named in your tablestyle will simply not appear. B.
  3. Yes, you CAN do: Dim i as New PictureBox B.
  4. Something along the lines of: Select StudentName, Count(CertificateName) from certificatetable GROUP BY StudentName Having Count(CertificateName) = 3 (not sure if the Having clause is portable away from MySql) completely untested, and off the top of my head. B.
  5. Of course, that means "The final thing you should do is call dispose" as when I read "The last thing you should do is call dispose" I panicked for a second - I *always* call dispose on disposable objects when I've finished with them!!! B
  6. 1. Access DB's have a place, but for a large-scale deployment, they are 'bad' 2. Access DB's have a maximum filesize of 2GB, or thereabouts. 3. If your current database is 9MB, you need to calculate how long it will be before you hit the 2GB limit. Once you hit this limit, your application will crash when attempting to insert or modify records. 4. Converting should be very simple, if you are converting up to SQL server. If you are converting to other types of database server, then ymmv. B.
  7. Don't use the "Microsoft Way " to do visualstyles, as they are inherently broken. Tab pages are just one symptom. Microsoft kinda 'hacked' the functionality in, from what I've seen. I would *thoroughly* recommend using the VisualStyles DLL from http://www.skybound.ca instead - it will actually work properly in all cases (and its free!) B.
  8. I would be tempted to create the tab page in the designer, then at runtime as the form loads, remove the tabpage from the tabcontrol. Then, when a user is double-clicked, insert a new instance of the tabpage into the tabcontrol. B.
  9. From my interpretation, the build numbers are in the form: Major.Minor.Day.CompileSession So, every different *day* that you compile the code, the third number increments. Every time you close VS, reopen it and compile, the last number increments. B.
  10. I second jmcilhinney's suggestion - the Skybound control is far superior to Microsoft's "broken" implementation of XP Styles. B.
  11. (assuming the value is stored as a Signed Byte) False = 0 True = "NOT" False: False = 0000 (in binary) True = NOT 0000 (in binary) = 1111 Using Two's complement, 1111 = (-1) so, True = -1 HOWEVER... VB.net will recognise anything that is "not" false as being true! B.
  12. As a quick hack, I usually append " |" to the .HeaderText to make the header move off the right-hand vertical column seperator B.
  13. Yeah, a normalised database with this sort of structure is unusual. You would normally have: Employee_Table: [EID] ... other employee details ... Permission_Table: [PID] .. other permission details ... Employee_Permissions_Table: [iD] [EID] [PID] This, as PlausiblyDamp mentions, allows you to have multiple permissions per employee, and multiple employees per permission quite easily. If you delete a "permission", you should delete all rows with a matching [PID] in the "link" table. Also, if you delete an employee, you should delete all rows in the "link" table with a matchine EID - this way the FK constraints all work correctly. B.
  14. Trying to optimise it slightly further, I'd probably go with something as follows (unless I parameterised it, of course): dim sWhereClause as String = "" dim bHasCriteria as Boolean = False For Each ctl In Me.Controls If TypeOf ctl is TextBox AndAlso ctl.Text.Trim().Length > 0 Then If Not bHasCriteria Then sWhereClause = " WHERE " Else sWhereClause &= " AND " End If If ctl.Tag = "N" Then 'Assign "N" to the Tag field of each numeric control when you create it. sWhereClause &= Ctl.Name.SubString(4, Ctl.Name.Length - 4) & "=" & ctl.Text Else sWhereClause &= Ctl.Name.SubString(4, Ctl.Name.Length - 4) & "='" & ctl.Text & "'" End If bHasCriteria = True End If Next ctl Forumised, untested code. B.
  15. Careful - the wildcard charater is not always '*' For example, on MySQL, the wildcard character is '%' C.
  16. Color_Pick.Color = Color.FromARGB(ini.ReadInt("send","CBVert",0))
  17. To be honest, if a real "<" or ">" character exists in an HTML page, the visible text between them would disappear, as your browser would parse it as an HTML tag, decide its an unknown tag, and drop it. The CORRECT procedure, as a_jam_sandwich says, is to use the < and > tags to show a "<" or ">" character in your page, and therefore the regex would work perfectly. B.
  18. String comparisons are case-insensitive, unless you explicitly state that they need to be case-sensitive. How you do that can depend on the server you're using. For SQL server, check out: http://vyaskn.tripod.com/case_sensitive_search_in_sql_server.htm B.
  19. How is your network resolving computer names? If you are using a windoze network, it is probably using SMB/NMB to resolve names. If your mySql box is not configured to use Samba, it will not be broadcasting its name across the SMB subnet, and therefore name resolution will fail. You have a few solutions available: 1. If you are using DNS internally, set up DNS records for your mysql host 2. If you are NOT using DNS, then configure Samba on the Mysql box 3. If neither of the above are suitable, edit the HOSTS file (c:\windows\system32\drivers\etc\hosts) on EVERY machine, and add a line corresponding to your Mysql box 4. Refer to the machine by IP address 5. Panic B.
  20. You might have to wrap the DisplayMember and ValueMember in []s, like: ComboBox1.DisplayMember = "[first name]" ComboBox1.ValueMember = "[employee id]" Try that! B.
  21. Try it in this order: ComboBox1.DataSource = ds_name.Tables("namelor") ComboBox1.DisplayMember = "first name" ComboBox1.ValueMember = "employee id"
  22. I second using the skybound controls for 2003 - we've used them for nearly a year now, and we have had very few issues. Those issues we have had have been dealt with by the developer (Andrew Young) within 24 hours. So, excellent product, and excellent support! B.
  23. Try quoting the ' with \ i.e.: 'Michael O\'Donnel'
  24. Is the firewall on computer2 blocking access?
  25. Imagine you have a database with a table in it. Imagine that you wish to represent this table in your code as a class. What is the most efficient (maintenance-wise) way of representing your database table? Currently, I'm trying to decide. I can either go for something like: Public Class MyClass Protected mID as Long Protected mSomeField as String Protected mSomeOtherField as Long .. repeat private member for each database field #Region "Properties" Public Property ID() as Long Get return mID End Get Set (Byval Value as Long) mID = Value End Set End Property (... repeat property for each private member) #End Region Public Sub New() ' perhaps overloaded constructor to handle loading by ID and pre-setting all values End Sub Public Sub Save() 'Various DB code to save back to database End Sub End Class Or, I could go with a Hashtable-type system, whereby the values are stored in a hashtable, which is the default property of my class. Problem with that is returning the various fields in the correct data-type. I would like this to be as EASY to maintain as possible - if a structural change is made to the database, it would be NICE if the code didn't have to be changed, but this is not a necessity. Somebody out there must have dealt with this problem and come up with a nifty solution? B.
×
×
  • Create New...