472 Posted Topics
Re: Here is another way that loops through the forms control collection to find the given control by it's name and passing in the form's control collection ([icode]this.Controls[/icode]) since you already added it to the collection ([icode]this.Controls.Add[/icode]): [code=csharp] public static bool EnableControl(System.Windows.Forms.Control.ControlCollection controls, string name, bool enable) { foreach (Control c … | |
Re: It looks like you are creating a new row, but you are calling [icode]Update[/icode] (missing UpdateCommand though too for that): [URL="http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbdataadapter.updatecommand(VS.71).aspx"]http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbdataadapter.updatecommand(VS.71).aspx[/URL] For inserting a new row, you need to specifiy an InsertCommand: [URL="http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbdataadapter.insertcommand(VS.71).aspx"]http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbdataadapter.insertcommand(VS.71).aspx[/URL] | |
Re: You might want to check into the MS reference source server for the latest source available for VS 2008. You must follow all of the instructions. It will add some overhead to the start of your debug session, but once you are satisfied with the code already downloaded to your … | |
Re: See if this article meets your needs: [URL="http://www.codeproject.com/KB/dotnet/XDMessaging.aspx"]alternative to .NET Remoting based on low-level Windows Messaging...[/URL] | |
Re: First, change this post to NOT be a snippet because that is not what a SNIPPET is for! Where it asks for "What are you posting?", just use the default: Forum Thread | |
Re: [code=csharp] Button[] btnsAry = (Button[])FindControlsOfType(/*this*/ form1, typeof(Button)); foreach (Button btn in btnsAry) btn.BackColor = Color.Red; [/code] Or, you could use a list (List<>): [code=csharp] List<Control> btnList = ListControlsOfType(/*this*/ form1, typeof(Button)); foreach (Button btn in btnList) btn.BackColor = Color.Red; [/code] | |
Re: [QUOTE=Calaesto;1053698]Hi, No excuses: my problem is that I can't get my code to check if a certain record exists in a MSA database. My code needs to check if the database contains a row where 2, 3 or 4 specified fields exist. But, as mentioned, at the moment it only … | |
Re: Post the code in question, or zip up the project so we can see what is happening. | |
Re: Just add the cast explicitly: [code=csharp] MouseEventArgs ee = (MouseEventArgs)e; [/code] | |
Re: Unfortunately, I don't think there a simple answer to this problem. I ran into this thread where a number of people reported problems and a "wild goose chase" ensued trying to pinpoint the problem. So, the thread is quite lengthy, but if you take the time to read through it, … | |
Re: [QUOTE=tincho87;1053558] [COLOR="Red"]C:\test\app.exe C:\plugin.dll C:\functions.dll[/COLOR] It doesn't work. [/QUOTE] In the above scenario, have you tried running the app with "C:\" in your PATH environment settings? It's not clear to me how your app is able to find and load the plugin.dll, but not the other. Could it be that the … | |
Re: In form1, you have defined a [icode]get[/icode] property setter to retrieve the string value, which you can do from form3. However, if you want to set the value of the textbox control on form1 from form3, you need to create a setter [icode]set[/icode] property too. The typical way to do … | |
Re: It's really a simple concept once you get a grasp on why you want to do this. Although you might have already considered this, I would expand the design to ensure that the presentation layer is also separated. The idea is to reduce the overall maintenance and increase the scalability … | |
Re: I hesitated replying to this because I haven't actually used the FileSystemWatcher, though I am somewhat familiar with it. I'm a little confused what you are asking. Are you saying that when you change the file that FileSystemWatcher doesn't see the change, or are you wanting it to throw an … | |
Re: Comments: In your btnAdd_Click event: [code=csharp] private void btnAdd_Click(object sender, EventArgs e) { //execute the counter as incrementor Counter++; //declare variable as integer int arrayCounter; //compare the counter less than 20 if (Counter <= 20) { //then arrayCounter will either add or equal to 1 arrayCounter = Counter += 1; … | |
[B]Overview:[/B] Oddly enough, MS never created a TreeViewDrowDown or equivalent. What I mean, is a control that looks and acts like a [icode]ComboBox[/icode], but contains a [icode]TreeView[/icode] instead of just a list when in the expanded drop-down mode. I've never understood why they haven't, but I always seem to want … | |
Re: All I did was look at this post and I hear sirens outside--just kidding. :D I can't wait to hear about everyone's experience once 7 has been out there a while... Out of curiosity, unless it is intended for network upgrades, what is the effective advantage of automating this? | |
Re: More information is needed: 1) structure of Employee 2) structure/contents of the DataSet returned by: [icode]DataBaseLayer.GetAllEmployees();[/icode] | |
Re: [QUOTE=adatapost;1052086]?Is it possible to use it to pass an unspecified number of arrays of objects? Yes you can do this. [code] void methodName(params object []v){ ... } [/code][/QUOTE] adatapost pretty much gave you the way to do this. Here is an example of manipulating the variable arguments of object should … | |
Re: I would learn both if I were you. I programmed in C/C++ for several years, and I will tell you that once I started coding in C#, I really don't like looking at C/C++ code anymore, but I can and do mostly for code conversions...:) As far as which one … | |
Re: Hey Roy. I'm a little new to using the report controls shipped with VS, but they make life so much easier I think. Anyway, I want to see what recommendations others might make for you. In the meantime, you could search the web for "CrystalReportViewer C# tutorial", or various other … | |
Re: Ignorant of the subject am I (definately not my forte) , but it sounds like you might need to write your own device driver to emulate the device. I might not be giving you any information here you haven't already considered; however, I ran across these links and figured I … | |
Re: Create a public method in your Form1 to access the control's text, then from the child form, just up-cast your MdiParent to Form1 and access the method: [code=csharp] // defined in Form1, or the MdiParent form... public void SetStatusLabelText(string s) { toolStripStatusLabel.Text = s; } // to call from child … | |
Re: This is a pretty good article as far as comparing Windows Forms to WPF at a high level: [URL="http://windowsclient.net/wpf/white-papers/when-to-adopt-wpf.aspx"]DECIDING WHEN TO ADOPT WINDOWS PRESENTATION FOUNDATION[/URL] To find examples of some technologies you are interested in, try looking on CodeProject.com and CodePlex.com. | |
Re: I suppose the main thing you are giving up is streamlined maintenance and scalability since you will need to manually copy and paste (or perhaps remove) segments of code anytime the size of the container gets changed. Why are you avoiding loops? | |
Re: To obtain the size of your list: [icode]properties.Count[/icode]. To access a member of [icode]Property[/icode] named [icode]pos[/icode] in a loop: [code=csharp] for (int i=0; i<properties.Count; i++) { if (player1pos == properties[i].pos) { // but, this will error (using i+1) if "i" is already at Count-1: player1pos = properties[i+1].pos; x = x … | |
Re: Are you asking how to find particular menu items, and then enable/disable menu items? Or, is your question more general about how to design user permissions into the menu design? | |
Re: Here is a good link to get you started: [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.control.keydown.aspx"]http://msdn.microsoft.com/en-us/library/system.windows.forms.control.keydown.aspx[/URL] | |
Re: Wow is right! As Ryshad suggested, you could do this without the array altogether. However, if you must use an array as part of the requirements, I would suggest using an array to represent the monetary denominations instead of a 1 to 1 representation of 0.00 - 1.00. For example: … | |
Re: If you intend to parse or convert the byte[] into its string equivalents, the [icode]StreamWriter[/icode] should work fine as long as long as it does not need to be thread safe. For thread safety, look at [icode]TextWriter[/icode]. If you just want to write the byte[] to a file, look at … | |
Re: Check the command text/query pass into the [icode]SqlCommand[/icode], which is what it is complaining about, but error doesn't show until you execute the command with [icode]ExecuteNonQuery[/icode]: [code=csharp] // // Summary: // Initializes a new instance of the System.Data.SqlClient.SqlCommand class // with the text of the query and a System.Data.SqlClient.SqlConnection. // … | |
Re: Problem is that in your string ("22.925507, 0.0000000, 0.0000000, "), the [icode]Split[/icode] has created a last item equal to a " " (space char), which the [icode]Convert.ToDouble(" ")[/icode] yields the exception. To correct, remove the trailing (last) comma. As an alternative, change line 20 (or similar check for spaces) to … | |
Re: [QUOTE=hu_yang;1052094]You can try the following link , it shows the basics of sending date paramter to Crystal Reports in C#. [url]http://csharp.net-informations.com/crystal-reports/csharp-crystal-reports-date-parameter.htm[/url] [/QUOTE] Follow the link yang gave you above. I would: 1) create two date parameter fields for the begin and end dates, then 2) use the Record Selection Formula … | |
Re: It would be a little difficult to explain ALL your options without knowing more about the C++ module and what you are supposed to do for this project... Here is some blogs with similar discussions: [URL="http://social.msdn.microsoft.com/forums/en-US/csharpgeneral/thread/ca03a370-4836-42ef-9912-6e9c45aa480c"]accessing C++ from C# gui...[/URL] [URL="http://stackoverflow.com/questions/1247968/fast-c-program-c-gui-possible"]Calling exported C functions...[/URL] [URL="http://www.gamedev.net/community/forums/topic.asp?topic_id=500289"]C++/CLI library...[/URL] | |
Re: avirag, this will import your excel data into a DataSet. If you need additional help writing the DataSet to Access table, please create another thread. Play with this and see if it works for you... [code=csharp] // NOTE: adaptor always returned error without full path of .xls file string connStr … | |
Re: The first thing you need is a database--do you have one? Then, you need to build a proper connection string to connect to it with: [URL="http://www.connectionstrings.com/"]http://www.connectionstrings.com/[/URL]. How you proceed from here depends on the database type, but the basic, most common stuff, involves: 1) Opening a connection 2) Building a … | |
Re: You might find this link helpful: [URL="http://www.codeproject.com/KB/cs/Trial_Maker.aspx"]http://www.codeproject.com/KB/cs/Trial_Maker.aspx[/URL] For Setup: [URL="http://www.codeproject.com/KB/install/msinetserial.aspx?display=PrintAll"]http://www.codeproject.com/KB/install/msinetserial.aspx?display=PrintAll[/URL] [URL="http://www.daniweb.com/forums/thread224137.html"]http://www.daniweb.com/forums/thread224137.html[/URL] [URL="http://www.codeproject.com/KB/install/easysetup.aspx?msg=1973769"]http://www.codeproject.com/KB/install/easysetup.aspx?msg=1973769[/URL] -- search for [B]SerialNumberTemplate[/B] in article... | |
Re: I searched my registry and found the following key, which returned 1.6.0_15 on my machine: [code=csharp] RegistryKey rk = Registry.LocalMachine; RegistryKey subKey = rk.OpenSubKey("SOFTWARE\\JavaSoft\\Java Update\\Policy"); string currentVerion = subKey.GetValue("InstalledJREVersion").ToString(); [/code] EDIT: If using the above, just concatenate the [icode]currentVersion[/icode] to the "Jdk version: " text: [icode]Text = "Jdk version: " … | |
Re: [QUOTE=chandru7;1050185]can't select or can't see,after datasource bind the data [CODE]DG1.DataSource=ds;DG1.DataSource="Material";DG1.DataSource=ds; DG1.DataSource="Material"; DG1.DataBind(); [/CODE][/QUOTE] In the above, your DataSource will contain the last object set: [CODE]DG1.DataSource=ds;DG1.DataSource="Material";DG1.DataSource=ds;[/code] will result in: [CODE]DG1.DataSource=ds;[/code] which is back to your original code... Try: [code=csharp] DG1.DataSource=ds.Tables[0]; [/code] And, for programmatically selecting rows, use a currency manager: [code=csharp] … | |
Re: Take a look at these similar links and loading images on separate thread: [URL="http://www.daniweb.com/forums/thread213640.html"]http://www.daniweb.com/forums/thread213640.html[/URL] [URL="http://www.daniweb.com/forums/thread210875.html"]http://www.daniweb.com/forums/thread210875.html[/URL] [URL="http://msdn.microsoft.com/en-us/library/8xs8549b.aspx"]http://msdn.microsoft.com/en-us/library/8xs8549b.aspx[/URL] | |
Re: The [icode]SaveFileDialog[/icode] facilitates the selection of filename and path to save the file, but you must perform the actual write of the data. See [URL="http://msdn.microsoft.com/en-us/library/sfezx97z.aspx"]How to: SaveFileDialog[/URL]. | |
Re: It is not clear to me what you are doing with this line and how you want it to expand and shrink. Can you provide the code with comments, or some images that represent the desired outcome? | |
Re: Not sure if this is your problem, but the documentation indicates you should create the event source during installation of the application: [QUOTE]Create the new event source during the installation of your application. This allows time for the operating system to refresh its list of registered event sources and their … | |
Re: First of all, use CODE tags: [code=csharp] ...code here.... [/code] Secondly, how is this a C# question, as your title suggests, when the code you have included is VB? | |
Re: You didn't mention the actual error, but at first glance, it appears you never allocate your array, [icode]arr[/icode], before attempting to assign the values inside your constructor. Try allocating it first in the constructor: [code=csharp] arr = new int[s]; [/code] | |
Re: Why do you want to reuse these id's once deleted--why does it matter? I would suggest that if your code is dependent upon id's being in consecutive order and gap free, that you might have a design flaw to begin with. If you are insistent upon pursuing this, check out … | |
Re: I don't have a LDAP server to play with. Here is an example of how to populate the child nodes using [icode]DirectoryEntry[/icode] component that might help you: [code=csharp] TreeNode users = new TreeNode("Users"); TreeNode groups = new TreeNode("Groups"); TreeNode services = new TreeNode("Services"); treeView1.Nodes.AddRange(new TreeNode[] { users, groups, services }); … | |
Re: In this example, the [icode]CellValueChanged[/icode] event is used to examine the cell when the value is changed. For your question, extract the code you need and just substitute the row and column indexes to refer to the known cell, which will allow you to "get" or "set" the [icode]Value[/icode] property … | |
Re: Here is an example for your messagebox question in which the ArrayList is cast to an Array, which the [icode]string.Format[/icode] method can then use to format a string with individual placeholders (eg. {0}, {1}, etc.): [code=csharp] ArrayList ary = new ArrayList(); ary.Add("one"); ary.Add("two"); ary.Add("three"); string s = string.Format("{0}\r\n{1}\r\n{2}\r\n", ary.ToArray()); MessageBox.Show("My … | |
Re: It sounds like you want to start with very basic examples of creating a project/application. Try searching the web for keywords like: "hello world c#" "DB tutorial c# .NET" where DB is the type you are interested, such as "SQL Server" or "Access" There are many websites out there that … |
The End.