Jump to content
Xtreme .Net Talk

Chong

Avatar/Signature
  • Posts

    81
  • Joined

  • Last visited

Everything posted by Chong

  1. I'm populating my datagrid with a dataset in design time. Is there a way I can use or call the UpdateCommand to update my database without rewriting the update sql query to update my database file? Many thanks in advance! ljCharlie
  2. Is there a way I can access another form's objects or instances without passing them through a function or sub routien? Here's my situation. I have a frmMain form that contains all my objects: buttons, panels, text boxes, datagrid, dataset and dataadapter etc.. Then I added a another class component, clsEvent, to my project. In this class, I want to be able to access all those objects in the frmMain form without passing them through a public shared sub. Is there a way? If there is way, mind give me a hand on this issue? Any help is greatly appreciated! ljCharlie
  3. Thank you very much. It works! That's exactly what I'm looking for. ljCharlie
  4. Will anyone show me how to delete a .rtf file in a folder for me? When I click the Delete button on the form, I like the to program to go into a folder which I specified the path and delete a file that matches a criteria. I'm using the SaveFileDiaglog to save the file, but I don't know how to delete it. Many thanks for any help! ljCharlie
  5. Thank you very much for the response. I think I like your first idea better. However, how do I load the string plus the text file both into the RTB? The string variable is not store in any database or file....it's created during run time. ljCharlie
  6. Is there a way to add texts before a RichTextBox file load? Here's my situation. I have a string variable that holds a bunch of data in it. Below is how I load the file into the RichTextBox. richTextBox1.LoadFile(filePath & strFileName, RichTextBoxStreamType.RichText) However, I want to add the string variable to the RichTextBox along with the data that comes from the file load. Another word, I want to combine the two and store into one richtextbox. Is there a way to do this? Any help is greatly appreciated! ljCharlie
  7. Thank you very much for the help. I like to the idea of keeping the image out of the database; however, how do I keep the text and the image synchronize when I'm loading them back? ljCharlie
  8. I need help with storing images in database. In my mdb file, one of the fields is declared as memo. Back in the vb.net program, I have a box declared as RichTextBox. When I paste an image into this RichTextBox and insert that into the mdb file, there is no error occure....but when I went back to the datagrid to load that entry into the datagrid, I found out that the image wasn't stored. In fact, the variable that holds the RichTextBox with the image shows nothing in between the quotes. So the question I have is, how do I store images with texts in the RichTextBox and store that somehow into a database file? One other concern is, once I am able to store the images into the database file, is the VB.NET datagrid able to show the images when populating the datagrid? I appreciate any help with this problem. ljCharlie
  9. Thank you very much for the reponse. The Xtragrid is not free, right? I'll take a look at it. Again, thanks! ljCharlie
  10. Is there a way to save the currently display datagrid into an excel file? If so, mind helping me with the steps? Thank you very much. Greatly appreciated! ljCharlie
  11. Thank you very much for the help. I found out that I have a veriable name called "Name" which is a reserved word. It's working now. Thanks! ljCharlie
  12. I'm getting an error when I run the program with the following message: And when I look at line 1107, there's this code: Me.Name = "mainForm" If I delete this line or comment it out then the program runs fine but with a warning about conflict variable name. However, after a couple of runs, the program will generate the same exact above error again. And this time, if I look at the line, 1107, again, the code Me.Name = "mainForm" is back. Does anyone have any suggestion why this happened? If anyone wish to see my whole project to help me diagnose, I'm willing to attach it in here or send it to you. I'm greatly appreciate for any help I can get. Thank you, ljCharlie
  13. I have three datasets that uses one datagrid to display the data. I need to format this datagrid to fit each dataset. However, I couldn't figure out how. Here's what I found out so far. In the DataGridTableStyle Collection Editor, I have created three members: 0, 1, 2. In each of these members, I have defined a GridColumnStyles collection in DataGridColumnStyle Collection Editor their properties. The problem I have right now is how do I call the DataGridTableStyle member at run time. I have three datasets that uses the same datagrid that is why I have three members in the DataGridTableStyle. But I can not figure out how to call the member that will correspond with a dataset that it is bind to the datagrid. Any help to do this task is greatly appreciated! ljCharlie
  14. Thank you very much for taking your time to help me with this problem. I'll give this a try. I'm greatly appreciated! Thanks again, ljCharlie
  15. Thanks for the offer. The form that I need help with is mainform.vb in sub rountine tlbrMenu. By the way, I forgot. When you run the program, the password and user form pop up first. Just lick OK. Currently there is no user name and password. Click any of the first three toolbar menu from left to right. The datagrid will be populated with some data. In the tool bar menu, you'll see a red X icon. This is to delete the row. ljCharlie computers.zip
  16. Jabe, thanks for the help; however, that didn't solve the problem. It wasn't deleting the selected row that I specify. It deletes the wrong row regardless of sorting or not. So Mehyar, how do I go about solving the issue if that's the case. ljCharlie
  17. It works! Well...there is still a problem. If I click on the column header to sort, then the first delete after I sorted wasn't accurate. Perhaps it seems like I need to refresh the datagrid or dataset to reflect the changes after the sort so when I typed in the row number in the text box to delete, it will delete the correct row. The other question I have is, why is it working with a number typed in manually into a textbox instead of selecting the row using the CurrentRowIndex? ljCharlie
  18. Cast it as what? ljCharlie
  19. On this particular dataset and dataadapter, I will get an error on my first try to delete. And like I said, if I try another dataset and dataadapter with different table in the database but still using the same datagrid then I was able to delete doesn't matter when but it's not deleting the row that I select to be delete. It looks like the deletion are either from top, bottom, or somewhere near the top. Now if I click on the column header to sort, then the delete will start from the bottom if the arrow points to the top, as I recalled, and viseversa. I believe this has to do with re-validation of the selected row on the datagrid. Unfortunately, I don't know how to do that. ljCharlie
  20. Regarding the Random deletion; well, it's not true. It depends on the arrow of the header in each of the columns in the datagrid pointed at. If the arrow pointed up, then the deletion starts at the bottom. If the arrow pointed down, then the deletion starts at the top regardless of what row I specify to be deleted. Any clue why this is happening and how do I fix this? Many thanks for the help so far. ljCharlie
  21. I figured out a part of the problem is when I test the code on another dataset and dataadapter using the same datagrid; however, I don't know how to solve it or detect it. Here's what I found out. In this statement:Dim dgRowNumber As Integer = dgComputer.CurrentRowIndex The code suppose to find the row that I select to be deleted and it did show the correct row number I want to delete. In this statement: DSetProgram.Program.Rows(dgRowNumber).Delete(), the dgRowNumber still show the correct row number to be deleted. However, when the code finish executing, the record that was deleted wasn't the one that I specify to be deleted. I tried this a couple of times and it seems to be that the deletion was random or it appears to be random despite what row I specify to be delete! So my question is, how/why this happen and how do I fix the problem? ljCharlie
  22. Thanks for the response. I said 6 counting from indexes of 0 not 1. If I count one then it'll be 7 rows but like you saide, .net count from 0 and so that's why I said 6 rows in the datagrid. Somehow this code works fine with another dataset and dataadapter using the same datagrid. I have three dataset and datadapter using the same datagrid depending on which button I click. And like said, somehow the other two dataset using this same datagrid work just fine deleting the rows except this particular dataset. Now I'm not what could be wrong about this dataset and dataadapter. It doesn't matter which row I select to be deleted, even if I select the first row in the datagrid, it would still give me the same error with the number after the word "Position" corresponds to the row I select to be deleted in the datagrid. ljCharlie
  23. Thanks for the generouse offer to help me. Here's what I've tried. But still it gives me the error that there is no row at the position of variable "dgRowNumber". So I tried this: But the same error happened. However, I have a total of 6 rows in the table called "Program". In addition, when the program runs, the variable "dgRowNumber" do have an actual number that corresponds to the datagrid. If this variable would to contain some number that is not relating to the datagrid or out of the range then yes, I understand but it's not. It is within the range of the rows in the datagrid and database table. ljCharlie
  24. Sorry to bother you again, but I encounter a problem with the delete command on how to delete a row. Somehow it only happens on this particular table. The error that I've been getting is There is no row at position 6. But I do have a row at position 6. I have tried to delete any of the rows in this table but none of them seemed to be deleting. What could it be? Any suggestion is appreciated! Thank you, ljCharlie
  25. Many thanks for your help. It worked! If I use Delete and it work, then what is RemoveAt use for? Again, I'm greatly appreciated for your help! ljCharlie
×
×
  • Create New...