Search results for query: *

  1. R

    How disallow duplicate items in datagrid view?

    Oh, I'm sorry! :o You are right. In that case, removing the outer loop should be enough.
  2. R

    Question Upadating the DataGridView control after editing one of its entries

    Just to make sure, can you check the bin\Debug folder for your application and see if Visual Studio has put a copy of your Access DB there. Also, have you tried creating a data source in the dataset designer using this table? Once you do that, you can drop the data source on to a blank form, and...
  3. R

    Question Inserting into a database using MySQL

    tj, nobody learns programming just by reading a book, so you're on the right track with experimenting. :) Ok, if it's an SQL syntax error, then you know it's nothing about your vb code. Your SQL string seems chopped off at the end, so I can't tell, but a common mistake is to forget to put a...
  4. R

    How disallow duplicate items in datagrid view?

    Hi trialer, I think there are two problems with your code. First, you actually need two loops; you need one to check dgv2 for duplicates, but you also need an outer loop to go through all the rows in dgv1. The second problem is that when you loop through the rows using For Each, that does not...
  5. R

    Question I need to modify the simple insert command code here

    Hi. I think it would be better to put that logic in the VB code and only go to the DB when it's a go. So, I'd do it like this. Can you work out the actual VB code? For i AsInteger = 0 To DataGridView2.Rows.Count - 2 'If column 4 is checked Then command.Parameters("@ColumnA").Value...
  6. R

    copy mysql table to ms access table

    Yea, I can't tell just by looking, either. Nothing jumps out at me. Like Menthos says, I'd suggest you step through the code to see exactly where it fails. Also, can you store your connection strings in your application settings? That way, they're tested and you don't have to build them on the...
  7. R

    Question Can't get SQL parameter to work here

    Yes, you're right. I finally got it to run in VB code. The SQL code was fine, but the Visual Studio dataset designer can't handle it. In addition to the behavior I described above, the designer ignores the parameter when saving the dataset. Consequently, the table adapter's fill method doesn't...
  8. R

    Question Can't get SQL parameter to work here

    SQL CE 3.5 -- This query returns a list of account numbers plus columns for current and late amounts, a simple A/R aging. SELECT accountnum, SUM(CASE WHEN DATEDIFF(d, GETDATE(), billeddate) < 31 THEN amount ELSE 0 END) AS curbal, SUM(CASE WHEN DATEDIFF(d, GETDATE(), billeddate) >= 31 THEN...
  9. R

    Data disapears when table structure is altered?

    This may be the problem, which I'm dealing with myself. When you create a new connection string or a new data source, you get the message "The connection you selected uses a local data file that is not in the current project. Would you like to copy the file to your project and modify the...
  10. R

    Detecting if my form is active

    Josh, hi, and yes, I think so, but isn't it better to put the code you want conditionally executed in a place the execution path is guaranteed to take when the desired condition happens? In other words, Application.OpenForms() works, but only when it is executed. What about the times the form is...
  11. R

    Suggestions wanted for online interactive DB

    Oh, webhosts that support SQL? No problem, most of them do. The only thing is that most of them support PHP/MySQL, so you'd have to find one that supported ASP. Personally, I've used 3essentials.com for my website, and they'v been good. They also offer ASP Windows Web Hosting From 3Essentials...
  12. R

    visual studio 2010 windows forms app screenupdating property

    Hey, bemis, getting into .NET after working in VBA is like listening to Australian. I mean, you know it's English, but... it's not. So what are you trying to do, mate? :) There's no such thing as screenupdating in .NET.
  13. R

    Detecting if my form is active

    The event is called Activated, but you don't test for it like you're doing in your code. Instead, you "hook in" to the event. You need to be in the editor, looking at the code for the form in question. At the top of the edit window, there are two drop down boxes. In the one on the left, click...
  14. R

    Order or invoice details table normalization

    Well, indeed, that's quite true. :) Of course, there's still the issue of payments, discounts, and any situation where the columns really are quite different, too different. After some research, this is what I came up with, in case it helps someone. Took me a while to find it, but generally...
  15. R

    Order or invoice details table normalization

    A lot of times the rows that make up the body of an "order" are not column compatible. Even in the case of an ordinary grocery tab, you have things sold by weight and things sold by the piece. So you need a column for "weight" and a column for "$/weight" when you ring up a half-pound of...
  16. R

    Which Database?

    Hi Ross, indeed you can have multiple users accessing a remote SQL Compact Edition database. Here's what the SSCE documentation says. CE does not support stored procedures nor multiple statements per query, however. Beyond that, I don't know enough to advise you. :o
  17. R

    Suggestions wanted for online interactive DB

    Are these three people on the same local network? You could use a spreadsheet, but while one used it, the other two couldn't. If they need to use it simultaneously, you could install an SQL engine on one of the three computers, and have the other two connect as clients. If you want to install...
  18. R

    Get identity of last inserted record

    Thanks for the suggestion. I think that's what I'll do. In case you're interested, I think I've found what the problem is. It seems that the scope of @@IDENTITY, at least in SQL Server CE, is restricted to the same connection. If you close and reopen the connection, it will return DBNull. I...
  19. R

    Get identity of last inserted record

    Thanks, ss, but SQL Server Compact Edition does not support stored procedures nor IDENT_CURRENT. The following code worked without a problem: Dim cmd As New SqlServerCe.SqlCeCommand cmd.Connection = New SqlServerCe.SqlCeConnection("Data Source=C:\Users\... \pos.sdf") cmd.CommandType =...
  20. R

    Get identity of last inserted record

    Using VS2010 and SqlCE 3.5, I have the following code. Me.Validate() Me.CasesBindingSource.EndEdit() Me.CasesTableAdapter.Update(Me.DbCases.cases) 'Now we need the identity of the record just added To retrieve the identity (autoincrement number), I created a query in CasesTableAdapter with...
Back
Top