Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

myNameIsRon

@myNameIsRon
About
Posts
161
Topics
81
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • DataGridView - Sorting [modified]
    M myNameIsRon

    Hi, I have Form app that includes a DataGridView control (bound to DataTable). The user can sort the columns by clicking the column headers. If the user has clicked the Date header (to sort the column), the code below fails to update all rows in the DataGridView (and Database). The list is fairly large (few hundred), so I can only guess that when a certain number of rows are updated (via - row.Cells["Col_ItemAddedDate"].Value = newItemDate;) a resort occurs that mucks up the foreach loop? If I don't update the DGV cell, the loop works fine to update database. foreach (DataGridViewRow row in dataGridView1.SelectedRows) { OleDbCommand myCommand = new OleDbCommand("UPDATE Products SET ItemAddedDate=? WHERE ItemID=?", myConnection); myCommand.Parameters.Add("@ItemAddedDate", OleDbType.Date).Value = newItemDate; myCommand.Parameters.Add("@ItemID", OleDbType.BigInt).Value = row.Cells["ItemID"].Value; // execute the command myCommand.ExecuteNonQuery(); // THIS CODE CAUSES THE LOOP TO FAIL (if the Col_ItemAddedDate column header is clicked to sort) // Some of the rows are updated, but some do not (both Database UPDATE and the DGV cell update will fail) row.Cells["Col_ItemAddedDate"].Value = newItemDate; } Ron

    modified on Monday, December 29, 2008 6:40 PM

    C# database algorithms question announcement

  • Trying to copy an access database file in VISTA
    M myNameIsRon

    Hi, Trying to use Windows Explorer to copy/paste a .mdb (MS Access file) to another folder. When I open the newly created file (in MS Access) I see that the database is emply (original file has data). It's like the copy reverts back to the original state (empty). The also happens when I try to email the database (.mdb) file. Ron

    Windows API database

  • Re: Invoke/Thread
    M myNameIsRon

    Yes, I've been playing around some. I'm not sure if it's a bug in .NET 2.0. After the transaction is approved, I want to exit the Form with "this.Close()" but it locks the app. If I switch to BeginInvoke it works ok. Also, I can use Invoke, if I open the form with ShowDialog instead of Show. Useful link: avoid invoke Ron

    C# question

  • Re: Invoke/Thread
    M myNameIsRon

    Thanks Mark, The SerialPortEvent calls on a Method to parse the c/c swipe data. Is Method run through the Invoke thread, or the main thread? private void SerialPortEvent(object sender, EventArgs e) { SwipeMethod(serialPortData); } Also, if I use ShowDialog() (instead of Show()) to open the Form, there is no issue with using this.Close(). Ron

    C# question

  • Re: Invoke/Thread
    M myNameIsRon

    Hi Mo, I'm using "this.Invoke()". Should I be using a different type of thread? If not, how do I stop "this.Invoke()"? Ron

    C# question

  • Re: Invoke/Thread
    M myNameIsRon

    Thanks Navaneeth, What code would I use to stop an "this.Invoke()" thread? Ron

    C# question

  • Re: Invoke/Thread
    M myNameIsRon

    Hi, I'm not very knowledgeable on threading... I'm using Invoke to receive Serial Port data. The form locks when I try and call "this.Close()". Do I have to remove/stop the Invoke thread before using "this.Close()" to automatically close the form? private void serialPort1_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e) { serialPortData = serialPort1.ReadExisting(); this.Invoke(new EventHandler(SerialPortEvent)); } thanks, Ron

    C# question

  • Update DataTable with DataGridView
    M myNameIsRon

    Thanks Ahsan, Yes, I could update the DataTable directly, but then I'd have use something like dataTable.Rows.Find() to correlate with the selected row in DataGridView. Do you know of a better way to find the DataTable row based on the selected DataGridView Row? Even if I do go the route of updating the DataTable directly, I'm always interested in learning more. I'm basically wanting to know the best way to sync the DataTable with the DataGridView if the DataGridView is edited. Ron

    C# question announcement

  • Update DataTable with DataGridView
    M myNameIsRon

    Hi, I have a DataTable bound to a DataGridView with this code: dataGridView1.DataSource = myDT_Items; I'm updating a DataGridView with this code: dgvRow.Cells["ItemSize"].Value = 55; Now I want the DataTable to reflect the changes made to the DataGridView. Currently I'm using: myDT_Items.AcceptChanges(); Q: Is there another way to Synchronize DataTable with DataGridView when changes are made to the DataGridView? Thanks, Ron

    C# question announcement

  • Changing indexed to NO in Jet DB
    M myNameIsRon

    Hi, I'm having problems finding out how to delete a field in a jet (Access) database via SQL code (using OleDbCommand in C# code). This field is set to Indexed=Yes (no dups). From my research, it looks like I have to change the Indexed to 'No' before deleting the field? I found this on the net, but if the field was created with MS Access app, I don't know the idxName to use in my SQL code. DROP INDEX idxName ON tblCustomers thanks for any help you can give, Ron

    Database database csharp help tutorial question

  • Odd Occurrence Happening...
    M myNameIsRon

    Hi, I've had people e-mail and open XML files (in Vista) and have them view/revert back to the original install file/data. - Open XML file in Notepad, the data shown is the original install data. - E-mail XML file, the data is reverted to original install data. - Open same XML file in Internet Explorer, the file shows up-to-date data. I run Vista and I don't have this problem. Can anyone shed some light on this issue? thanks, Ron

    XML / XSL help xml question

  • & or + to join fields/text?
    M myNameIsRon

    Thanks guys, I didn't realize it was specific to Access SQL. I did some testing, and here it is. If your field is NULL, and you're using '+', the join is ignored. SELECT ID_Field + ' - ' & NameField FROM table ID_Field not null: 3433 - Bob Smith ID_Field null: Bob Smith SELECT ID_Field & ' - ' & NameField FROM table ID_Field not null: 3433 - Bob Smith ID_Field null: - Bob Smith Ron

    Database performance question

  • & or + to join fields/text?
    M myNameIsRon

    Hmmm, Both will work for me. I'm using a MS Access db with OleDbCommand (C#) Ron

    Database performance question

  • & or + to join fields/text?
    M myNameIsRon

    Hi, Please refresh my memory... What the difference is between using & or + to join fields with text. SELECT FirstName + ' ' + LastName AS FullName FROM table or SELECT FirstName & ' ' & LastName AS FullName FROM table thanks, Ron

    Database performance question

  • Get Data Type of field/column?
    M myNameIsRon

    Thanks John! I thought there might be an issue if no rows were returned, but it works great, thanks! Ron

    Database database csharp question

  • Get Data Type of field/column?
    M myNameIsRon

    Hi, Is it possible, with an SQL statement, to retrive a column's data type? Note: working with MS Access 2000 database (OleDbCommand in C#). Ron

    Database database csharp question

  • MS Access Versions
    M myNameIsRon

    Hi, My WinForm application uses an Access 2000 file format database (using OleDbCommand with C#.NET). I'm wondering if I should upgrade to a newer version (2003 or 2007). Can anyone tell me the advantages of usng Access 2003/2007 over 2000? thanks, Ron

    Database csharp database question announcement

  • ADOX
    M myNameIsRon

    Using ADOX (in C# form application) to update a Jet 4.0 database Supposedly I should be able to change a column’s REQUIRED property by using this code: cat.Tables["Products"].Columns["ItemReorderDate"].Properties["Nullable"].Value = true; Found at: http://msdn2.microsoft.com/en-us/library/aa140022(office.10).aspx Unfortunately, it gives this error: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done. Is ADOX “Nullable” not compatible with Jet 4.0? If not, is it possible to change the REQUIRED property to "NO" by a SQL command for Jet 4.0? Thanks, Ron

    Database database com csharp help question

  • Having issues with Object comparison [modified]
    M myNameIsRon

    OK, I see now... I'm a fairly new programmer (with no formal training), so I'm not familiar with object comparison. The other methods (min, max) use IComparable, but they don't bother using it for the ColumnEqual method. I've changed: return (a==b); //value type standard comparison to: if (((IComparable)a).CompareTo(b) == 0) return true; else return false; works great now, on the different data types and my OleDbCommand string results. Ron

    C# database com question

  • Having issues with Object comparison [modified]
    M myNameIsRon

    Hi again joon, I've been playing around with the stock code again... I've noticed that if you try and Group By the other columns (OrderID",Int32) [I did change a few rows so some are the same value], it will not group. The stock code only seems to group on a string column? Could you check it our with your sandboxapp? thanks, Ron

    C# database com question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups