2,157 Posted Topics
Re: You don't provide enough information about the tables, but it would be something like: [code]UPDATE Students SET Student_Level = (SELECT Level_ID FROM Level WHERE Level_Name = @TextboxLevel) WHERE FirstName = @firstName AND LastName = @lastName[/code] Some of the field I made up since I don't know what you call them … | |
Re: I've have the code to several different generic sorts in C# over [URL="http://www.daniweb.com/software-development/csharp/code/351309"]here[/URL] with some relative timings. | |
Re: [QUOTE=NewOrder;1521838]i know how to serialize, but is it possible to send the serialized object over the net and make it be retrieved to the original state?[/QUOTE] Depends on what the List contains. Most likely you won't have issues. | |
| |
Re: Why are you dividing the factorial by 2 in line 23? Also, you don't reset the factorial value each time through the n loop, so in the i loop it remultiplies the values 1 through n-1 to the previous factorial. | |
Re: If you split on space you'll get 24 parts. I'll leave you with [URL="http://msdn.microsoft.com/en-us/library/ms131448.aspx"]this[/URL] link to understand why | |
Re: [code]String original = "{1 2} 3"; String temp = original.Replace("{","").Replace("}",""); int pos = temp.LastIndexOf(' '); String first = temp.Substring(0, pos); String last = temp.Substring(pos+1);[/code] | |
Re: I don't see that they expose anything that will give you this information (or any information about the rendered size). | |
Re: Lines 5-10: Convert.ToString on string variables doesn't do anything. Lines 20-28: These lines do nothing you can remove them. What makes you think the user name wasn't updated? | |
Re: [code]Dictionary<String, Double> sortList1 = new Dictionary<String, Double>(sortlist2);[/code] | |
Re: Even harder since I have no CD player in my car! | |
Re: This line[code]sortList4.Add(gk, value1[0]);[/code]is going to assign the same value to every entry in your list. Did you mean to say[code]sortList4.Add(gk, value1[c]);[/code]? | |
Re: I don't see the constraint clause in your table creation. You'll also need to change the name of the constraint for each table. | |
Re: [code]string loginUri = "http://www.somesite.com/login"; string username = "username"; string password = "password"; string reqString = "username=" + username + "&password=" + password; byte[] requestData = Encoding.UTF8.GetBytes (reqString); CookieContainer cc = new CookieContainer(); HttpWebRequest request = (HttpWebRequest)WebRequest.Create (loginUri); request.Proxy = null; request.CookieContainer = cc; request.Method = "POST"; request.ContentType = "application/x-www-form-urlencoded"; request.ContentLength … | |
Re: You have a problem with your InsertNode method. It can't insert right side nodes since there is no 'else' for the line 39. You need to go over your closing } characters as you are missing one at one point and have an extra one at another. | |
Re: 1) Highlight the text you want to be a link. Click the button on top of the editor that looks like a planet with a piece of chain on it (a [I]link[/I] of chain). Enter the url and click ok. All done. If you want to do it by hand, … | |
Re: No. The various data structures have different usages for which they are suited. No one structure is applicable to all situations. | |
Re: [QUOTE=;][/QUOTE] Lines 5-9: You say they have to be private, but you declare them public. | |
Re: And if you are only expecting one value you should use ExecuteScaler() not ExecuteReader(). | |
Re: After setting [I]Deny logon locally[/I] did you set [I]Impersonate a client after authentication[/I]? It's what ASPNET does to prevent logging in, might work for you. | |
Re: Your database code is very messed up. Take a look at the example at the bottom of [URL="http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.aspx"]this[/URL] page. You'll be doing 2 ExecuteNonQuery() calls instead of the ExecuteReader() code. | |
Re: Most likely SID is a string so you need to change your code to[code]ch1 = "select Sno from Student where SID = '" + @smemno.Text + "'";[/code] Notice the single tick marks ('). And there is no need to call ToString() on a text field. | |
Re: You could try [URL="http://shop.lego.com/Product/?p=8547"]Lego Mindstorms[/URL]. Still costs some money, but you can do more than just a roving webcam. | |
Re: [QUOTE=;][/QUOTE] There is nothing between the numbers to split on. If you know they are all just a single character, then you can do:[code]StringBuilder sb = new StringBuilder(); foreach (char c in ipt) { sb.AppendLine(c); } StoreRoom.Text = sb.ToString();[/code] | |
Re: I've had to fix a program where the author used variable names "Flag1", "Flag2", ... "Flag46" (and "Switch1", "Switch2", ... "Switch50"). But enough of coding horrors ... I disagree with some of the style you mention. Most styles I've run into use Pascal case for method names (first letter capitalized) … | |
Re: System.Version cannot be inherited. But it already has the operators overloaded. Higher version numbers are greater than lower version numbers. Higher version numbers are newer, if you are doing it right. | |
Re: There are many ways to connect, I'd check out [URL="http://connectionstrings.com/ibm-db2"]connectionstrings.com[/URL] | |
Re: [code]//update all your labels Application.DoEvents(); Thread.Sleep(500); [/code] | |
Re: [code]Console.WriteLine("\t{0}:\t{1}", mySL.Keys[i], mySL.Values[i]);[/code] | |
Re: [code]private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { // Do whatever here e.Handled = true; }[/code] | |
| |
Re: When you hit the X in the corner, the form closes, it doesn't exit the application. But the startup form is run from Program.cs which has this line [icode]Application.Run(new Form1());[/icode]. When the form closes, the line following this one is run, and there is nothing there so the application exits. … | |
![]() | Re: [URL="http://www.microsoft.com/express/Downloads/#2010-Visual-CS"]Visual Studio Express Edition[/URL] |
Re: It only asks for one default argument, and wants you to call the method twice in your main code, once with just a movie name and once with a name and minutes. | |
Re: You can do it in the form.designer.cs file, along with all the other attributes that are set there in the InitializeComponent method. | |
Re: Use your second struct to hold the data. And you are trying to use VB syntax to declare an array. Use: [code]downloadInfo[] downloadlist = new downloadInfo[size];[/code] where size is the size of the array. If you want a variable size data structure, use List<T>:[code]List<downloadInfo> downloadlist = new List<downloadInfo>();[/code] | |
Re: You don't reset your counts when you enter a new plate. Move lines 5-8 to right inside the do loop. Your if statement in line 27 needs some work, as does the else part. | |
Re: No, you should only have one parameter, credit. Get rid of the limit parameter. Otherwise you did the default value fine. | |
Re: Line 65 and 66: [code]Console.WriteLine("The average is {0}", avg); Console.WriteLine("The sum is {0}", sum);[/code] | |
Re: You could speed it up a bit by checking if 2 is a divisor, then if not go into a loop starting at 3 and incrementing by 2. There is also no need to check if the divisor is prime as the first divisor you find will always be prime. … | |
Re: Oddly enough, I'm not going to watch the video, figure out what they are doing and then solve your problem. Post your code, point out the problem you are having and where it occurs. | |
Re: Are you using the connection the entire time? What is the database connection timeout set to on both the client and the server? What code are you using to access the database? Do you check the connection to see if it is open before you use it? | |
Re: [code]namespace WindowsFormsApplication1 { public partial class Form1 : Form { private Boolean hasScroll = false; public Form1() { InitializeComponent(); } private void richTextBox1_ClientSizeChanged(object sender, EventArgs e) { hasScroll = !hasScroll; } } }[/code] The field [B]hasScroll[/B] will be true when there is a scrollbar, false otherwise. Make sure you attach … | |
Re: You SQL statement has no parameters, yet you add two to them. Your reader returns every single userid/password in the database, yet you only read the first entry. Readers are usually in while loops. You can fix this by using [icode]SELECT COUNT(*) FROM user1 WHERE username = @username AND password … | |
Re: [code]int[] iArray = new int[5]; for (int i = 0; i < iArray.Length; ++i) { Console.Write("\nEnter a value: "); iArray[i] = int.Parse(Console.ReadLine()); } Console.WriteLine("Maximum value is {0}", iArray.Max()); Console.WriteLine("Minimum value is {0}", iArray.Min());[/code] If you need to do it the way you are, just set iLrgest to Int32.MinValue, and compare … | |
| |
Re: Without seeing any code how could we possibly know what is causing the issue? Post the code where the problem is happening. | |
Re: [code]Type t = asm.GetType("cGame");[/code] You need the full name here [code]Type t = asm.GetType("namespace.cGame");[/code] | |
Re: The first line is "Create a console-based application". Are you sure you need a GUI-based application? | |
Re: It looks like your code it taking longer to run than a tick event, so it just gets set back each loop. Try something like this: [code] Color c = label1.ForeColor; int colorRed = c.R; int colorGreen = c.G; int colorBlue = c.B; colorRed++; colorGreen++; colorBlue++; if (colorGreen == 192) … |
The End.