472 Posted Topics
Re: Can you zip and attach the small application (project/solution) in question with any relevant word doc (is it in English?)? | |
Re: if you want it to be accurate, you need to calculate up front the total items to be processed (scanned?), then divide into total items already processed * 100.... Here is an example of using BackgroundWorker with file copies in which the total number of bytes of all files to … | |
Re: Those default namespaces and references, depending on the type of project that is created, are added because the chosen type of application or library requires them. Are you wanting to create a project template that can be chosen like "Windows Form Application", or "Console Application"? [URL="http://msdn.microsoft.com/en-us/library/xkh1wxd8.aspx"]How to: Create Project Templates[/URL] | |
Re: Try this code. I modified your path construction to use backslash and added exception handling to provide specific error information. [code=csharp] string database = @"C:\Users\Jessie\Documents\Visual Studio 2008\Projects\Face\DAT\DTR_DB.s3db"; string connParams = @"Data Source={0};Version=3;New=False;Compress=True;"; string connStr = string.Format(connParams, database); SQLiteConnection conn = new SQLiteConnection(connStr); try { conn.Open(); } catch (SQLiteException ex) { … | |
Re: I believe I understand what you want, and I don't think it is possible with user control. I have also wanted to create custom controls utilizing UserControl without the need to manually expose each of the methods and properties of the container controls. If and when you figure it out, … | |
Re: [code=csharp] // Set the number of rows to step through... progressBar1.Maximum = ds.Tables[0].Rows.Count; // Set the increment size... progressBar1.Step = 1; [/code] then to maintain progress: [code=csharp] cmd1.ExecuteNonQuery(); // Increment progress... progressBar1.PerformStep(); [/code] You should also move the [icode]sqlConn.Open();[/icode] outside of your loop, which is why I didn't include it … | |
Re: Given the code sample and question, you only need to declare the methods static within a class and you can reference/call them anywhere as long as you establish a reference within your project and call the method by it's fully qualified name. For example: [code=charp] namespace MyNameSpace { public class … | |
Re: Yes, for example: [code=csharp] public class class1 { public static int GetCustomerID(string lastname, string firstname) { int id = -1; // TODO: db query here... return id; } } public partial class Form1 : Form { TextBox textBox1 = new TextBox(); // I put here for reference only... TextBox textBox2 … | |
Re: You could synchronize the 2nd WebBrowser's loaded page using the [icode]webBrowser1_Navigated[/icode] event handler: [code=csharp] private void webBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e) { if (bSychronize) { if (webBrowser1.Url.ToString() != webBrowser2.Url.ToString()) webBrowser2.Navigate(e.Url.ToString()); } } [/code] In the above, the boolean [icode]bSynchronize[/icode] can be toggled by a button click event: [code=charp] private void button1_Click(object … | |
Re: As ddanbe said, and you can use the FindItemWithText method to retrieve the corresponding item: [code=csharp] private void SetReservation(string time, string reservation) { // find item with matching time... ListViewItem item = listView1.FindItemWithText(time); if (item != null) { // Set value for reservation column... item.SubItems[1].Text = reservation; } } [/code] | |
Re: I believe you are referring to Jan Dolinay's "Detecting USB Drive Removal in a C# Program"? This is not part of the .NET framework to my knowledge. In addition, the CodeProject download contains only the DriveDetector.cs file, which defines the Donlinay namespace; so there probably is not an external library … | |
Re: What is it you want to do with your panel? Here is an example that draws some text whenever it is repainted, and the form has a button to change the 'value' of the text: [code=csharp] using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; … | |
Re: You might refer to this similar discussion to see if it helps you: [URL="http://social.msdn.microsoft.com/forums/en-US/netfxbcl/thread/aa8c9bde-5cb5-44e4-b9e2-7608470ce08e/"]http://social.msdn.microsoft.com/forums/en-US/netfxbcl/thread/aa8c9bde-5cb5-44e4-b9e2-7608470ce08e/[/URL] | |
Re: Here is an example I put together that creates a table with background image using HTML. The HTML is inline and does not import a CSS file--sorry. I'm no expert in the subject, but wouldn't the import be performed by the client (browser, outlook, etc.) and not gmail, thus eliminating … | |
Re: It doesn't matter whether the form is visible or not. I put this form demonstration together for you to see how the forms can manipulate the other forms' lists. Add them to a form project and call [icode]Application.Run(new Form_modal())[/icode] | |
Re: Take a look at this MS link and look at the example code where instead of filtering numeric digits, they filter everything else... Just modify that code to only accept the characters you want. Cheers! [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.control.keypress.aspx"]http://msdn.microsoft.com/en-us/library/system.windows.forms.control.keypress.aspx[/URL] | |
Re: I noticed this link posted by adatapost, which seems to use the dashed outline on the drag you are looking to replicate, but cannot be sure because I did not get to see your IMG tag. Anyway, it's a TreeView drag/drop I believe, but the owner drawn stuff is probably … | |
Re: You have your "sr" and "sw" naming conventions reversed :D, but that is not your problem... Your call to [icode]b[i] = sw.Read();[/icode] will only read a character at a time, which is why you cannot get the values you expect, presumably. Look at the [URL="http://msdn.microsoft.com/en-us/library/system.io.streamreader_members.aspx"]Read method spec[/URL] and see if … | |
Re: Dates need to be enclosed with hash (#) symbol. Try: [code=csharp] string str = "Select * from Customer where SubmitDate between #" + str1 + " 12:00:00 AM#" + " and #" + str2 + " 12:00:00 PM#"; [/code] | |
Re: Might be your using named parameters... Are you getting NULL values in the table? Try changing "@" to "?" and see what you get. | |
Re: Once you remove all the references to your button objects stored in your array, the garbage collector will take care of the cleanup. You can then reallocate (reuse) your array for further usage. [code=csharp] // step 1 allocate... ButtonArray = new Button[10, 100]; // step 2 remove reference to button … | |
Re: Please have a look at this: [URL="http://dotnetperls.com/dllimport-interop"]http://dotnetperls.com/dllimport-interop[/URL] | |
Re: EDIT: NEVERMIND THIS BECAUSE I DIDN'T SEE YOU HAD THE DEFINITION POSTED: [I]Are you sure the [icode]CompareStrings[/icode] method is always return true? From what library is your [icode]CompareStrings[/icode]? Look at the definition to determine it why it is always returning true.[/I] Why are you selecting the 'matching' record for username … | |
Re: [QUOTE=vinnijain;944756]Hi!!!! Example we enter "One crore twenty lakh thirty four thousand seven hundred eighty four" , then its corresponding numeral should be "12034784". [/QUOTE] This looks familiar. See: [URL="http://www.daniweb.com/forums/thread209656.html"]http://www.daniweb.com/forums/thread209656.html[/URL] | |
Re: You have indicated you are getting a "null reference" error, and you have provided a snippet that does not reveal the cause of the error; unless it is because "em" has not been instantiated. I suggest you zip up the project and attach it with data. If you cannot do … | |
Re: It's probably due to a difference between the version of VS you have and the version of VS discussed in the tutorial you are using. Try stepping through your wizard and see if you can identify the options you are concerned with that your tutorial or book discusses. If still … | |
Re: I didn't see where there was any change to this method for Windows 7. Perhaps you want the SaveFileDialog flexibility: [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.savefiledialog.aspx"]http://msdn.microsoft.com/en-us/library/system.windows.forms.savefiledialog.aspx[/URL] You can set the [icode]InitialDirectory[/icode] to be whatever drive:path concerns your application. | |
Re: Twice I have received "token expired" error trying to reply to this... I am really peeved! Anyway, run the program outside the debugger and check the debug\application.exe.config file for the changes. I would explain further, but I've already wasted a 1/2 hour trying too... EDIT: I'll try to elaborate briefly … | |
Re: I don't use express version, but this looks like a nice step-by-step article for creating a database in Sql Express using VS: [URL="http://www.homeandlearn.co.uk/csharp/csharp_s12p2.html"]http://www.homeandlearn.co.uk/csharp/csharp_s12p2.html[/URL] | |
Re: To convert your [icode]byte[][/icode] to an image: [code=csharp] public static Image ByteArrayToImage(byte[] buffer) { using (MemoryStream ms = new MemoryStream(buffer)) { System.Drawing.Image img = System.Drawing.Image.FromStream(ms); return img; } } [/code] or if cannot use [icode]Image.FromStream[/icode] method (no CF support): [code=csharp] public static Image byteArrayToImage(byte[] byteArrayIn) { // Write the byte … | |
Re: Take a look at the [URL="http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx"]FileSystemWatcher component[/URL], which you can add to your form. Here is a Daniweb snippet of its usage too: [URL="http://www.daniweb.com/code/snippet217135.html"]http://www.daniweb.com/code/snippet217135.html[/URL] | |
Re: You didn't call your method. At line 19 you are writing out the abbreviation. Try: [code=csharp] Console.WriteLine("State is {0}", FromAbbreviation(abr)); [/code] In addition, you are already comparing to lower text [icode]switch(abr.ToLower().Trim())[/icode] at line 24, so all of those [icode]case[/icode] labels you have for checking upper-case abbreviations will never test true--you … | |
Re: Because each element of "m" will reference the same "record" object, which will contain whatever the last items added to the record are. You need to move the creation of the "record" into the loop so that each "record" of "m" is a different object: [code=csharp] for (int i = … | |
Re: I'm not sure how your "web application" is deployed and you cannot simply access the file system on a client from a web service, but I won't make assumptions since you indicated you have "FCR" folders already setup on the clients. Try adding some exception handling around your file IO: … | |
Re: UPDATE tablename SET columnname1='value' WHERE columnname2='value'; If the value is numeric, leave off the ticks ('...') around the value. | |
Re: Not sure why you would ask this question rather than just test out your code to see if it does indeed work, but the code is nicely structured for the most part. [LIST] [*]Your test for valid username/password will display a message box for every line read following the initial … | |
Re: You can allow your user to select the file to open with [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.openfiledialog.aspx"]OpenFileDialog...[/URL], then use [URL="http://msdn.microsoft.com/en-us/library/dsh84875.aspx"]XmlSerializer.Deserialize[/URL] to read in your object(s). Once your object is loaded, just populate the form(s) with the read data. You might also want to see: [URL="http://msdn.microsoft.com/en-us/library/bdxxw552.aspx"]Serialize method...[/URL], which you can use with your filename to … | |
Re: You may also wish to consider this [URL="http://www.daniweb.com/forums/thread236486.html"] discussion of INI file interface[/URL] and why you shouldn't use it. | |
Re: You cannot assign a CR image path dynamically in vs 2005, but here is a work around you can use: [URL="http://dotnetfish.blogspot.com/2009/02/dynamic-image-in-crystal-report-9.html"]http://dotnetfish.blogspot.com/2009/02/dynamic-image-in-crystal-report-9.html[/URL] | |
Re: Maybe someone in here will know LISP, but you would probably get a much faster response if you translate the above LISP code into pseudo code first, then we can translate that into C# code. | |
Hi. I decided to try out the Report Wizard, having only worked with Crystal Reports prior, and when I try to connect to an Access DB with the default OLE DB data provider, I get "Unspecified Error" in the Add Connection dialog upon "Test Connection" or trying to accept the … | |
Re: What happens when you run it outside the application from a command prompt? Does it create a log file? Does it create any Event Log entries? What are the errors it returns? | |
Re: Have a look at these: [URL="http://www.codeproject.com/KB/edit/htmlrichtextbox.aspx"]http://www.codeproject.com/KB/edit/htmlrichtextbox.aspx[/URL] [URL="http://blogs.vbcity.com/hotdog/archive/2005/12/30/5759.aspx"]http://blogs.vbcity.com/hotdog/archive/2005/12/30/5759.aspx[/URL] [URL="http://sourceforge.net/projects/rtf2html-lite/"]http://sourceforge.net/projects/rtf2html-lite/[/URL] [URL="http://www.codeguru.com/cpp/controls/richedit/conversions/article.php/c5377/"]http://www.codeguru.com/cpp/controls/richedit/conversions/article.php/c5377/[/URL] | |
Re: You cannot simply estimate time based on samples and, as I am sure you are aware, no progress for downloading from the web is extremely accurate. Given that is true all around, user's expect there to be plus/minus whatever they have experienced... In light of this, the best you can … | |
Re: What you want is INSERT INTO ... VALUES(...): [URL="http://msdn.microsoft.com/en-us/library/bb208861.aspx"]http://msdn.microsoft.com/en-us/library/bb208861.aspx[/URL], because the INSERT INTO ... SELECT FROM inserts fields FROM another table and you want to insert your [icode]TextBox.Text[/icode] VALUES into your table. It is unclear to me why you have what appears to be mixture of controls and control Text … | |
Re: See if any of these are helful: [URL="http://codesmithdotnet.blogspot.com/2008/01/programmatically-input-data-on-form-and.html"]http://codesmithdotnet.blogspot.com/2008/01/programmatically-input-data-on-form-and.html[/URL] [URL="http://geekswithblogs.net/rakker/archive/2006/04/21/76044.aspx"]http://geekswithblogs.net/rakker/archive/2006/04/21/76044.aspx[/URL] | |
Re: EDIT: Scratched response... Please see: [URL="http://msdn.microsoft.com/en-us/library/s35hcfh7(VS.71).aspx"]http://msdn.microsoft.com/en-us/library/s35hcfh7(VS.71).aspx[/URL] | |
Re: Your email address was removed because forum protocol prohibits it. Take a look at this MSDN example: [URL="http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.aspx"]SmtpClient example...[/URL] | |
Re: I don't see a Delete command from your code sample. See: [URL="http://msdn.microsoft.com/en-us/library/bb177896.aspx"]http://msdn.microsoft.com/en-us/library/bb177896.aspx[/URL] | |
Re: [code=csharp] DateTime datetime = DateTime.ParseExact("10/10/2009 12:00:00", "MM/dd/yyyy hh:mm:ss", System.Globalization.CultureInfo.CurrentCulture); [/code] Also, have a look at this: [URL="http://msdn.microsoft.com/en-us/library/system.datetimeoffset.tryparseexact.aspx"]http://msdn.microsoft.com/en-us/library/system.datetimeoffset.tryparseexact.aspx[/URL] |
The End.