2,157 Posted Topics

Member Avatar for nammae

[QUOTE=Lusiphur;1336893]The one thing that concerns me is that, based on your original code, you should never have an unassigned value as there is only even or odd if dealing with an integer and it shouldn't be looking for a 3rd option. Unless you're somehow dealing with a negative integer... Brain …

Member Avatar for nammae
0
108
Member Avatar for Anon17

The system maintains a connection pool already, so your forcing everything into one connection isn't helping at all. Each query should use it's own connection object and unless you are making 1000s of queries a second, you aren't going to run into memory issues because of database connections. Is there …

Member Avatar for Anon17
0
183
Member Avatar for Wootens

You don't give nearly enough information as there are a lot of ways to generate the "next subset".

Member Avatar for Momerath
0
59
Member Avatar for prathoven

Nothing wrong with it. The first argument must resolve to a true/false (boolean) value. Yours resolves to a object, just as the compiler said. Try changing it to read: [code]savedPassword = (Application.UserAppDataRegistry.GetValue("newpassword")) != null ? Application.UserAppDataRegistry.GetValue("newpassword").ToString() : "defaultPassword";[/code]

Member Avatar for Momerath
0
90
Member Avatar for rutul

[QUOTE=mono_jit23;1336590]If i split the string and put it into a single array then every odd index is filled with a number and even index with signs(+,-,*,/). I don't think it will be so much different than using two separate arrays, rather it will optimize the code. :D[/QUOTE] Arrays start at …

Member Avatar for mono_jit23
1
1K
Member Avatar for dimmslider
Member Avatar for dimmslider
0
140
Member Avatar for bbman

[code]FileStream f = File.Open(@"D:\TestData.txt", FileMode.Create); f.Close();[/code]

Member Avatar for Lusiphur
0
129
Member Avatar for julianfr

[code]public Dictionary<String, List<String>> FileParser(String fileName) { Dictionary<String, List<String>> myDictionary = new Dictionary<string,List<string>>(); using (StreamReader sr = new StreamReader(fileName)) { List<String> temp = null; String index = null; String line; while ((line = sr.ReadLine()) != null) { if (line.StartsWith("AH")) { if (temp != null) { myDictionary.Add(index, temp); } index = line.Substring(2); …

Member Avatar for Momerath
0
98
Member Avatar for Usmaan

Just put your [I]Do This[/I] code inside the btAdd_Click() method. It will only execute when the button is clicked. There is no need to add a check anywhere in your code, the IDE has done that for you.

Member Avatar for Usmaan
0
18K
Member Avatar for algo_man

1.[code]Set result = 0 for each element in sequence A1..An, in reverse order, do if current element = key then set result = current index exit for loop end if end for output result[/code] 2.[code]set result = 0 for each element in sequence A1..An-1 do if current element > next …

Member Avatar for arkoenig
0
150
Member Avatar for chandruswami

One way to do this is to start a transaction, insert into the audit table, then do the update. By using a transaction, you ensure that both changes are made successfully, or nothing happens at all (don't want an audit record when there is no change, or a change when …

Member Avatar for Momerath
0
96
Member Avatar for Rhuntsman21

To answer your original question, the reason it only removes one control is because you are using if/else if. The first one that matches causes all the others to be excluded. Remove all the 'else' keywords and it will work how you think it should. To the second poster, why …

Member Avatar for Rhuntsman21
0
215
Member Avatar for jammiedude

Two things; Check that your [B]Email[/B] variable is set correctly. Add [B]smtp.DeliveryMethod = SmtpDeliveryMethod.Network;[/B] Another thing is you should catch the specific exceptions being thrown, rather than the generic [I]Exception[/I]. This will give you more information on why your code is failing: [code]SmtpClient smtp = new SmtpClient("10.0.0.1"); smtp.DeliveryMethod = SmtpDeliveryMethod.Network; …

Member Avatar for jammiedude
0
136
Member Avatar for eyeripper

Normally I see .00r files as part of a RAR archive. If it's not, the software at this link says it can read them [url]http://profile.software.informer.com/[/url]

Member Avatar for eyeripper
0
73
Member Avatar for buster2209

Another way to do this is start a new windows application, then go into the properties and switch it to a command line application. This gives you both a window and a command box.

Member Avatar for Diamonddrake
0
685
Member Avatar for Mikahi

Use a dictionary<String,WhateverYourArrayIs> to hold all the values, and use the name to look them up in the dictionary.

Member Avatar for mshauny
0
72
Member Avatar for vihrao

nick.crane is correct. Since you are using the built in serializer, and you have the DateTimeType object, it's going to include it. Implement IXmlSerializable and define how you want your objects serialized.

Member Avatar for nick.crane
0
157
Member Avatar for iamnoangel26

If the top search result on google is your question asking about it, it probably doesn't exist.

Member Avatar for ocmseo
0
62
Member Avatar for muzikhera

What database are you using? If SQL Server, then something like: [code]public void ReadData(string connectionString) { string queryString = "SELECT employeeID FROM employee;"; using (SqlConnection connection = new SqlConnection(connectionString)) { SqlCommand command = new SqlCommand(queryString, connection); connection.Open(); SqlDataReader reader = command.ExecuteReader(); try { while (reader.Read()) { Console.WriteLine("{0}", reader[0]); } } …

Member Avatar for Momerath
0
89
Member Avatar for oluscoa
Member Avatar for Momerath
0
45
Member Avatar for oluscoa
Member Avatar for Momerath
0
60
Member Avatar for zerey02

In a stored procedure, the value of @@IDENTITY is the last indentity field generated. So I'd create a procedure to do the insert and return that value. Then you can use it to update your linking table (and they are tables, not databases :))

Member Avatar for Geekitygeek
0
194
Member Avatar for ja0

I suspect one of your values has a single ' mark in it, and this is throwing off your SQL statement. This is one of the reason you should use [URL="http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlparameter.aspx"]parameterized[/URL] statements, along with helping prevent a SQL injection attack.

Member Avatar for ja0
0
156
Member Avatar for Rhuntsman21

[URL="http://ts.nist.gov/WeightsAndMeasures/Publications/appxc.cfm#1"]This[/URL] might help. Or are you looking for something else?

Member Avatar for Rhuntsman21
0
103
Member Avatar for zachattack05

Use whatever makes you happy. Microsoft added the 'x' to things to indicate that they are now in XML format vs. their old formats. Use 'backup' if you want :)

Member Avatar for zachattack05
0
92
Member Avatar for Excizted

[URL="http://academic.research.microsoft.com/Paper/428576.aspx"]Reactive Pedestrian Path Following[/URL] [URL="http://www.hindawi.com/journals/asp/2009/935237.html"]Pure-Pursuit Reactive Path Tracking[/URL]

Member Avatar for Excizted
0
417
Member Avatar for nssltd

You are probably using the built in WebBrowswer control to handle page rendering. Since this is IE, of course it's going to do what IE does (save history). If you want it to stop you could try setting the InPrivate Browsing to be on (if using IE 8. If your …

Member Avatar for nssltd
0
166
Member Avatar for swapnil_lautre

Your best bet is to create a method that takes a TabPage as a parameter, then creates the controls, attaches event handlers and adds them to the TabPage. That way you only have to design it one time, then can use it exactly each time. What you can do is …

Member Avatar for Momerath
0
115
Member Avatar for grannum12
Member Avatar for rcanter

Your structure Item contains Status, Title, Series, Author, TYpe and Description. It has a method called Item, but you are using it as a Property in line 47. Not sure what you are trying to do with that line, so can't suggest a fix :) BTW, it would be helpful …

Member Avatar for rcanter
0
2K
Member Avatar for Suzie999

[url]http://www.codeproject.com/KB/system/GetHardwareInformation.aspx[/url]

Member Avatar for Suzie999
0
159
Member Avatar for IDC_Sharp
Member Avatar for Anon17

Your problem probably comes from line 25 where you are attaching another reader to the socket each time you receive a message. You should have the reading in a loop or disconnect the current reader from the socket before you call Run() again. This should fix your problem: [code]private void …

Member Avatar for Anon17
0
619
Member Avatar for nssltd

That's because you are looking at [B][COLOR="red"].[/COLOR][/B]h, scroll down more where the [B][COLOR="red"].[/COLOR][/B] goes away

Member Avatar for Momerath
0
79
Member Avatar for IDC_Sharp

Without seeing your code, how could anyone tell you what you might be doing that would slow down your software?

Member Avatar for IDC_Sharp
0
83
Member Avatar for marvin42

Check out XNA, it has a [URL="http://msdn.microsoft.com/en-us/library/bb197911.aspx"]Matrix structure[/URL] with a 3d transform

Member Avatar for Momerath
0
187
Member Avatar for yamini222

You do lots of strange things in your code: [code]for (int v = 0; v <= str11.Length - 1; v++)[/code] You do this one a lot. "v <= str11.Length - 1" is the same as "v < strl11.Length". No need to subtract one all the time, it's just more work. …

Member Avatar for yamini222
0
144
Member Avatar for rico078

[QUOTE=prvnkmr449;1328122][CODE]private void btnAddImages_Click(object sender, EventArgs e) { form_target myform = new form_target(); myform.Show(); myform.CopySelectedItems(lstviewTarget); this.Close(); }[/CODE] It will work [/QUOTE] It will work if your goal is to briefly show the form then close it. [I]myform[/I] is a local variable and thus will go out of scope as soon as …

Member Avatar for Geekitygeek
0
100
Member Avatar for zachattack05

Using IDBConnection, IDbTransaction, IDbCommand, IDbDataParameter and IDataParmeter you can access most of the functionality of the various data providers without knowing which one you are actually using. So at runtime, instead of saving your connection as a SqlConnection (or OleDbConnection, etc.) you'd use and IDbConnection variable. As for sharing it, …

Member Avatar for zachattack05
0
117
Member Avatar for Arnos

[code]Color myColor = (Color)Enum.Parse(typeof(Color), <textfromcombobox>, true);[/code] Enum.Parse take three parameters: The type, the text to convert and whether it should ignore case or not (true = ignore).

Member Avatar for ddanbe
0
162
Member Avatar for ddanbe

He's talking about VS 2010, which is Net 4. And I'm not sure what you mean, it's right there in the System.Numerics namespace. Make sure you have a reference to the System.Numerics.dll in your project.

Member Avatar for ddanbe
0
98
Member Avatar for DaveTran

If I understand what you are trying to do, you could reset the flag when b is accessed: [code]private int myB; public Boolean bHasChangedValue; public int B { get { bHasChangedValue = false; return myB; } set { if (b != value) { b = value; bHasChangedValue = true; } …

Member Avatar for Geekitygeek
0
127
Member Avatar for anitha10

You can shorten your SQL to [code]cmd.CommandText = "SELECT count(*) from UsersTable AS ut WHERE ut.UserName = @UserName AND ut.Password = @Password"[/code] If it's not zero, then you have 1 (or more) users.

Member Avatar for Geekitygeek
0
171
Member Avatar for judithSampathwa

Learn [URL="http://msdn.microsoft.com/en-us/library/ms754130.aspx"]WPF[/URL]

Member Avatar for Diamonddrake
0
149
Member Avatar for hanvyj

You need to add some form of locking when you are accessing the list. Read [URL="http://msdn.microsoft.com/en-us/library/c5kehkcz%28VS.80%29.aspx"]this[/URL].

Member Avatar for hanvyj
0
1K
Member Avatar for farsen
Member Avatar for zachattack05

[QUOTE=zachattack05;1321095]I mean it basically means nothing right?[/QUOTE] Which is the same for any method at all. You can call a method anything you like, and it can do anything you like. By convention and unwritten agreement programmers try to name methods so that someone reading the code can make a …

Member Avatar for embooglement
0
168
Member Avatar for ashu2401

This is how I'd do it in C#: [code]Boolean foo(int[] a, int b) { Boolean result = false; Dictionary<int, Boolean> c = new Dictionary<int,Boolean>(); for (int i = 0; i < a.Length; i++) { if (c.ContainsKey(b-a[i])) { result = true; break; } else { c.Add(a[i], true); } } return result; …

Member Avatar for arkoenig
0
329
Member Avatar for jigglymig1

[QUOTE=Akill10;1325686]Stab in the dark here but would [code] String num; for (i=1; i < 6; i++) { if ("num"+i < 0) neg = neg + 1; if ("num"+i == 0) zero = zero + 1; if ("num"+i > 0) pos = pos + 1; }[/code] would this work?[/QUOTE] No, it …

Member Avatar for Momerath
0
201
Member Avatar for DaveTran

struct is considered a value type, and thus us non-nullable. You can make it a nullable type (by using the ? operator) but this has it's own issues as you'll have to redefine the inner portions of your struct. Just change struct to class and all is good in the …

Member Avatar for Momerath
0
125

The End.