Jump to content
Xtreme .Net Talk

karimgarza

Avatar/Signature
  • Posts

    35
  • Joined

  • Last visited

Everything posted by karimgarza

  1. link for countries here is the link for each country http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemglobalizationcultureinfoclasstopic.asp
  2. Localized date try the following Dim sometime As System.DateTime 'us english Dim us As New System.Globalization.CultureInfo("en-US") 'spanish from mexico Dim mx As New System.Globalization.CultureInfo("es-MX") Dim strDate As String strDate = "31/12/1980" sometime = CType(strDate, Date) '-----> for the US Dim mySelect As String = "SELECT name, age FROM MyTable WHERE birthdate > #" + sometime.ToString("d", us) + "#" myCommand = New OleDb.OleDbCommand(mySelect, MyCon) '------> for MExico Dim mySelect As String = "SELECT name, age FROM MyTable WHERE birthdate > #" + sometime.ToString("d", mx) + "#" myCommand = New OleDb.OleDbCommand(mySelect, MyCon) This solution is a little bit better because you are actually localizing the date formats. The really best solution would be (and I am talking about SQL server 2000 I do not know about other DBMS) to create a store procedure and give it the the localized date as date type. Best of Luck
  3. A better way is to use dates all the time Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim sometime As System.DateTime sometime = Now ListBox1.Items.Add(Now) ComboBox1.Items.Add(Now) ComboBox1.Items.Add(sometime) End Sub Store the date values in the listbox or combobox as dates and never convert them to strings because you will have problems when you get the application in a region where the dates are in a different format. Hopes this Helps Best of Luck
  4. did you add the relationships to the dataset. here is what I do after I create the relations <code> 'get the parent and child columns parentCol = DS1.Tables(0).Columns(strFirstKey) childCol = DS1.Tables(1).Columns(strSecondKey) ' Create DataRelation. Dim relContractorDivisions As DataRelation relContractorDivisions = New DataRelation(RelationshipName, parentCol, childCol) ' Add the relation to the DataSet. DS1.Relations.Add(relContractorDivisions) 'Create a DataView mdat = New DataView(DS1.Tables(0)) </code> in here I am just setting up a relationship between the Contractor Table and a Division Table. Keep me posted to know how you are doing. sorry I can't provide the full example but I always belive that everybody needs a push in the right direction to get going. Best of Luck
  5. Thank you for your help this site Has everything I need. Karim
  6. I have successfully extended controls in my project. What I want to know is how to put a "link" at the bottom of the properties to open a form, such as the auto format in the datagrid. I would greatly appreciate the solution. Karim
  7. Try the following code to see if is still returning row 0 Private Sub DataGrid1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles DataGrid1.MouseDown Dim hti As System.Windows.Forms.DataGrid.HitTestInfo Dim myGrid As DataGrid = CType(sender, DataGrid) hti = myGrid.HitTest(e.X, e.Y) Select Case hti.Type Case myGrid.HitTestType.Cell MsgBox(hti.Row.ToString) End Select End Sub [/Code]
  8. There are (I think) two errors in your program: the first one is that you are concatenating the insert statements in one string and you want to execute them all at once which is not allowed. You have to do each one at a time. the second error is related to the first you are reading all the records and then trying to execute the insert. What you have to do is to make the insert right before your while statement. this way you will execute inserts one at a time. Hope this helps. I included more or less the way you should code it try it and see what happens I did not have time to run it, but i did ran the Insert example you provided and Access did not accept it. correctcode.vb
×
×
  • Create New...