Hi there! I need some help please; I am trying to parse an excel file and it is parsing all rows just fine except for the row that is set as currency format. This row is returning a null. Can somebody help please. Thanks
Sameer
Hi there! I need some help please; I am trying to parse an excel file and it is parsing all rows just fine except for the row that is set as currency format. This row is returning a null. Can somebody help please. Thanks
Sameer
I have in place an application that sends faxes using a single modem card loaded on a server. I am installing a second modem card on the server and I was wondering if anybody out there knows how it will effect my current coding. I am trying to allocate traffic to both cards, is that done automatically by windows? How will the statuses be reported? Please help as I can't find any information or manual that explains this. Thank you in advance
Sameer
Hi guys, I am in a bit of dilemma and need some help please!!! Here is my scenario I have a couple datagridviews which populate data from a dataset I have cell_click event which is used to move data from one grid to another. If there is no empty cell in my grid2 then I add a column in the cell click event and populate data into the new column cell. I also have a drag drop event which I use to move data across grid2, after I do the cell click for some reason it doesn't let me do drag drop, it says object reference not set to an instance of an object in the new cell where the data is being dropped. My assumption is that after I add the column, for some reason there is a null reference on all cells except the added data cell. How do I add the column, update the dataset and the datagridview without reloading the data in the grid. Hope I make sense. Please helppppp
Sameer
Thank you Dave for the guidance. I have switched my code back to your suggestion for the most part. I now have a background worker that does the following: On form load I am calling the runworkerasync dowork: retrieves all the data to database and assigns it to a datatable Completed: Assigns datatable to datagridview datasource Now I need to run a format grid function that goes through the grid and formats some cells. Where do I call that, should I call that in the completed of the worker? Please advice
Sameer
Pardon my ignorance as I am not the best in using threads. Currently on load of child form I am calling the runworkerasync method of the background worker with retrieves data and upon completion assigns dataset to grid and formats the grid. Here is the change I have made and I am getting an error of cross thread operation. worker1 Async in form load do work retrieves data from database Completed calls Worker2Async Worker2 Async in Completed of Worker1 Do work assigns datagridview datasource to dataset containing data retrieve by worker1 Completed formats the grid I am getting an error in Do work for Worker 2, when I call datagridview.datasource=dataset, it says cross thread operation... datagridview accessed from a different thread then the one it was created in... Any suggestions, am I doing what you suggested? Please help
Sameer
It's definately frm2 = new frmGrid2(m_ADBCnn, TechnicianstoolStripMenuItem1.Text, frm1); and frm2.show(). The part that takes long is the loading of the child form because it pulls quite a bit of data so it opens it but then the grid in child form is blank until all data is pulled. Sameer
Sameer
Thank you for your prompt response. Is there any way you could give me an example. I tried using a background worker but that doesn't work because of MTA restrictions. I was getting a dragdrop.... error. I tried initiating a regular thread and that is not working either because of what you suggested "GUI stuff on the GUI thread" All I am doing is GUI stuff, here is the code in my button click on mdi to open child form A try { this.Cursor = AdvancedCursors.Create(Path.Combine(Application.StartupPath, "wagtail.ani")); if (frm2 != null) { frm2.Close(); } frm2 = new frmGrid2(m_ADBCnn, TechnicianstoolStripMenuItem1.Text, frm1); frm2.CellClicked += new CellClickedEventHandler(frm2_CellClicked); if (frm1 != null) { this.frm1.CellClicked += new CellClickedEventHandler(this.frm2.frm1_CellClicked); this.frm2.CellClicked += new CellClickedEventHandler(this.frm1.frm2_CellClicked); } frm2.Show(); frm2.MdiParent = this; this.VerticalTiletoolStripMenuItem1.PerformClick(); } catch (Exception ex) { MessageBox.Show(ex.Message); }
Sameer
Hi guys, I need some help please. I have a parent form (mdi) where a context menu item click opens up a child form, that child form takes a long time to load and so I wish to somehow allow the user to be able to click on a different context menu item click while child form A is being loaded. Please advice of a way of doing this. Thank you in advance.
Sameer
Nevermind, I found a great example: Passing Values between Forms in .NET 1.x with C# and VB.NET examples[^] Thank you for the direction.
Sameer
Hi Musefan, Thank you for your prompt response. Pardon me but I have never used custom events, is there any way you can show me an example, I will appreciate it. Thanks
Sameer
Hi guys! Please help, I am trying to pass data from form1 to form2 using a datagridview cell click event (passing data from datagridview1 in form1 to datagridview2 in form2) It is working fine if I open form1 and then form2, if I open form2 before form1 then it doesn't because it can't capture instance of form1 to access it. Here is what I am doing presently: in Parent (MDI), I have a public form instance for form1, I use that when I open form1 and then pass that instance to form2 when I open it. This is what I am doing: In Parent: public frmGrid1 frm1; .... //Form1 click event in parent frm1 = new frmGrid1(m_ADBCnn, 1, notWorkedToolStripMenuItem.Text); frm1.MdiParent = this; frm1.Show(); .... //Form2 click event in parent frm2 = new frmGrid2(frm1,m_ADBCnn,1,presentToolStripMenuItem.Text); frm2.Show(); frm2.MdiParent = this; I then assign frm1 in the constructor of form2 as follows: private frmGrid1 frm1; public frmGrid2(frmGrid1 f1) { try { InitializeComponent(); frm1 = f1; } catch (Exception ex) { MessageBox.Show("Failed on initialization: " + ex.Message); } } Again, this works if I open form1 before form2. How can I retrieve frm1 from frm2 if it is null? Please help
Sameer
Hi guys, I am having a weird issue, I am trying the following and for some reason varchar(50) value is set to null when I encrypt or decrypt it. If I change it from varchar to nvarchar it works. Our table in the database is already set to varchar to store the encrypted information and can't change it due to licensing issues. Please help, what am I doing wrong? OPEN SYMMETRIC KEY DSBEncryptionKey DECRYPTION BY CERTIFICATE EncryptDsb DECLARE @encryptedNum varchar(50) -- varchar doesn't work here, nvarchar works SELECT @encryptedNum=EncryptByKey(Key_GUID('DSBEncryptionKey '), '111000614'); select CONVERT(varchar(50),decryptbykeyautocert(cert_id('EncryptDsb'), NULL, @encryptedNum)) FYI, my symetric key uses AES_256 algorithm. Please help!
Sameer
what I am doing is reading the file names into a string array and then using foreach loop to process each file. This is incase there are multiple files. It seems to be doing a good job with the threading and the thread.sleep. I wonder if there are more system resources being used with my approach, I will monitor the error log and hopefully there won't be any issues :)
Sameer
Happy to hear that it is a good method. A different client creates and dumps these files. Usually, there is a single file at one point and what my application is doing is processing these files and dumping it to an Archive folder.
Sameer
Hi Luc, As always thank you for your response. My windows service in short looks at 3 folders for .csv files, parses them and does some database updating. From time to time there are files added to these folders so I have to keep looking at a certain interval in these folders (currently configured every 20 minutes) I decided to implement the following method: http://en.csharp-online.net/Creating_a_.NET_Windows_Service%E2%80%94Alternative_1:_Use_a_Separate_Thread[^] Please let me know if this is not a good method, I would hate to crash the server because that is where this service will be loaded :) Thanks
Sameer
hi Abhijit, Thank you for your response. I went with the following procedure and the service seems to be running fine. Please advice if this is not a good idea for a windows service http://en.csharp-online.net/Creating_a_.NET_Windows_Service%E2%80%94Alternative_1:_Use_a_Separate_Thread[^]
Sameer
thank you for your response. I am using timercallback currently, sorry for my ignorance in threading but I am not sure how to modify all my current code to implement your method.
Sameer
Hi Luc, Sorry for the delay in my response and thank you for your responses. I couldn't implement your code, I am not sure if I am doing something wrong. I have put in another posting requesting guidance on building a service with a thread that looks at a folder for files and processes the file. Upon completion of the processing, it starts over again. Help if you can please on that.
Sameer
Can somebody please give me an example of a windows service that uses threading to look at a folder for files and if it finds a file then does some processing. Upon completion of processing looks again and continues... I don't know if it is wise to keep looking at a folder every second for files, please advice on that. If it is not then maybe put a wait and look every 20 minutes or so. Please help!! I don't need code to look for files, etc. I just need some guidance on how to build the service with a thread. Thank you in advance
Sameer
Hi Luc, I am not sure if I understand you. However, I want to finish running one, and then start the new one. Basically if monitorfunc has not finished I want to pause the call if one minute is passed. Then start the call once it has finished. I hope I am making sense. Please advice.
Sameer