Jump to content
Xtreme .Net Talk

Nerseus

*Experts*
  • Posts

    2607
  • Joined

  • Last visited

Everything posted by Nerseus

  1. You have a few options: 1. You can set SizeMode to Fixed and set the ItemSize property to the width you want. 2. You can use the Padding property to make each tab have a little extra padding. This will not create fixed width tabs, but just pad the text on each one. -Ner
  2. Check a couple of things: [*]Your event is still hooked up [*]You're in Debug Mode (if you're testing with a breakpoint) [*]You're setting a breakpoint right at the top of the event, not farther down (after a potential error) [*]There are no errors in the constructor [/list=1] -Nerseus
  3. There might be a better way... what exactly are you trying to do? Meaning, do you *just* care about the rounding part? If so, using the Math library is the best option. Or, are you talking about your use of DateDiff, a VB-specific function? For that, I'll need to know what you're trying to do (I don't know what m_Frequency is, for example). -Ner
  4. Ah... finally, all the pieces are coming together (sorta). Take me drunk officer, I'm home, *hic* -Nerseus
  5. Ah, whew. Well, the alternative is to NOT use the CommandBuilder (it's kind of a beginner's helper class more than anything). You can use the CommandBuilder while in development, but look at the SQL string it builds for you (the CommandText property as I mentioned above). Once you have the INSERT string that the CommandBuilder built for you, you can do away with the CommandBuilder and hard-code the string for yourself. It will mean manually updating the string as your database changes. But, it also gives you more controls over the SQL you're using. For example, the default SQL might look like: INSERT INTO TABLE1 (ID, Username, Password) VALUES (?, ?, ?) As you've seen, this won't work since Password is a reserved word. Instead, replace the string with: INSERT INTO TABLE1 ([iD], [username], [Password]) VALUES (?, ?, ?) Notice the square brackets. You can *always* use square brackets on column names. If you ever forget and your column is a reserved word, you just might get this exception again. For example, "id" is a reserved word in SQL Server... Better safe than sorry and use the square brackets and NOT use the CommandBuilder. -Nerseus
  6. Nerseus

    Speed up

    Can you post the project here so we can take a look? Also, your bitmap may be odd shapes (non-powers of 2 is "odd" for DirectX), but most hardware won't support it. Instead, you'll want to make your bitmap a power of 2 and use a color key to leave out those bits you don't want. So instead of having a bitmap at 259x347, you'll have to use 512x512. Assuming your bitmap is non-rectangular already (you have some bits being masked out), you can just use that same "mask" color to fill in the rest of the bitmap, to extend it out to 512x512. -Nerseus
  7. IndexOf is case-sensitive. I think you'll have to code that type of "in string" comparison yourself, unless VB.NET supports the same InStr function as VB6 along with VB6's "Option Compare Text". I'm not that familiar with VB.NET... If you can't do the query in SQL on the database, can you do it against a column in a DataSet? The DataSet's DataTable supports a Select statement that can do the above type of searching client-side. For example (couldn't test this in VB.NET - no sample DataSet projects at the moment): DataRow[] rows = myDataSet.Tables["Table1"].Select("memotext LIKE '%dan%' AND memotext LIKE '%jones%'"); if(rows.Length > 0) Debug.WriteLine("found"); else Debug.WriteLine("not found"); -Nerseus
  8. Well from what I remember, there is the VB version of DHTML and then there's just Dynamic HTML, which is best supported by IE. The DHTML project type in VB was flawed when it came to scalability - it just wasn't. And, since it required IE to run, it limited its use to those clients that ran on an intranet. If you already had your clients nailed down to IE, then you had lots of other options including client-side controls, bound XML data islands, and other nifty tricks that WERE/ARE scalable. It was a good idea, but it just wasn't practicle for large-scale applicaitons. Since the main benefet of web applications are scalability, developing a solution based on a non-scalable architecture didn't seem to fit. But, in terms of a robust UI, I believe DHTML was a step in the right direction. I only played with the DHTML project type a LONG time ago, so I may not be remembering things exactly right. -Nerseus
  9. Do you mean a single string variable? You can use the IndexOf method: Dim s As String s = "hello world this is dan jones and I love .NET" If s.IndexOf("dan") > 0 And s.IndexOf("jones") > 0 Then Debug.WriteLine("Found") Else Debug.WriteLine("Not Found") End If
  10. Can you show us the value of "daUsers.InsertCommand.CommandText"? It should be something like "INSERT INTO table (col, col, ...)". I'm guessing there's still an issue with the column names or table name... -Nerseus
  11. Weird, you can do this in C#. Try this instead: If TextBox1.ForeColor.Equals(System.Drawing.Color.Red) Then Debug.WriteLine("red") Else Debug.WriteLine("not red") End If -Nerseus
  12. Comparing the ForeColor the way you're showing works fine for me. Are you sure it's actually System.Drawing.Color.Red and not just the color "red"? I tried this by using the ForeColor property of a TextBox and a GroupBox control, both worked just fine. I used C# but I don't think it would make a difference. -Ner
  13. Assuming your search words are 'dan' and 'jones' and you're searching on a field named 'memotext', here's what the SQL should look like (use a DataReader or a DataSet/DataAdapter to run the SQL): SELECT * FROM Table1 WHERE memotext LIKE '*dan*' AND memotext LIKE '*jones*' This would assume you want to find records that have BOTH 'dan' and 'jones'. If you want either word, use 'OR' instead of 'AND' above. -Nerseus
  14. I was talking about the UpdateCommand (the SQL for performing updates to the database), not the Update method :) I think (I can't check right now), that "users" is a reserved word. I should have mentioned to make sure column AND table names are not reserved words. -Nerseus
  15. It should open directly to Adobe, if they have it installed correctly (meaning, the PDF extension is still registered to Adobe). You can check by using Google's Advanced search and select the format of PDF (just to find some in a browser to test with). Clicking one should open in the browser without any questions. That will work IF you are linking directly to a file the user has access to. If you're streaming it to them, you'll have to add some headers to "mark" the stream as a PDF file. I can dig something up if that's the case. -Nerseus
  16. If you don't need the DataView for anything else I wouldn't use it. Also, don't you want each item to be a separate string? Try something like this: Dim dr As DataRow For Each dr In dsUtgiftspost.Tables("dtUtgiftspost").Rows lstBelop.Items.Add(dr("Total").ToString("c")) Next -Nerseus
  17. I can't imagine there's so much C# code out there that you would need to have a quality conversion tool. If it's just sample projects that you need converted, to learn from or to mimic or extend, I would guess the two programs you mentioned would work fine. Converting the rest of the code shouldn't be too hard, I wouldn't guess. If you run the conversion and need some specific questions answered, we're always here to help. :) -Nerseus
  18. I don't know if there's a built-in way to do it. You can loop through the DataTable and add each item, of course, and format each Total as currency as you go (use the ToString("c") method). -Nerseus
  19. Can you post the entire error message? Also, use Debug.WriteLine (or something similar) to view the InsertCommand string that the CommandBuilder creates and post that, too. Check that you don't have any reserved words for column names. For example, if you have "First" and "Last" as column names, you won't be able to use the CommandBuilder to generate your SQL for you since it won't properly bracket reserved words. I don't think this would be your problem, but it might be: make sure you create an UpdateCommand as well as an InsertCommand, if you're also updating rows that is. -Ner
  20. What's wrong with the code you have? It looks perfect... -Ner
  21. Your first problem is that you can't call Close within the Load event. You can try moving the code to your constructor, but I'd rethink your strategy on forms first. For example, maybe the MDI form should be showing Form3 and if it's not Cancel THEN show Form2. If you set the MDIParent property, you're telling Windows that this will be a child window, to be placed "inside" of an MDI Parent. It can't be inside AND be a modal window. Basically, if you're a child window, set the MdiParent property to the parent form and call Show. If you're modal, don't set MdiParent (or set it to Nothing if you already set it to a form), then call ShowDialog. -Nerseus
  22. You say you don't like the idea of "fake" messagebox's, but what you want is a non-standard messagebox. Or, to put it differently, you really don't want a message box at all :) If you decide to code your own, you can use the Graphics object's measurestring method to get the size of text to make sure your label will be big enough. Actually, you can change the size of your form and assuming you set the anchor property of the label, the label will resize automatically. -Nerseus
  23. Given your quote, my first response (none), was perfect - apparently no help was required :) -Nerseus
  24. What are your requirements for storing data? You say it's a stand-alone project so you would probably go with Access or MSDE. Knowing what you plan on storing would make it easier to make suggestions. SQL Server requires licensing that I don't think your users are going to want to pay for not to mention having to install SQL Server just to use your program. -Nerseus
  25. I agree that DataViews are tied to a DataTable and it would be nice to have them referenced through the DataTable as a collection. If your new DataSet class is complete with the DataView collection, maybe you could post it here? -Nerseus
×
×
  • Create New...