407 Posted Topics

Member Avatar for waleed.makarem

This looks like VB.NET, not C#. In either case, neither directly inherits from the other; therefore, you can't cast between the two types. The do however, share a base class: `System.Data.Common.DbConnection`. You could, possibly, work with a DbConnection class directly. If there are specific functions implemented by the `SqlConnection` or …

Member Avatar for waleed.makarem
0
163
Member Avatar for israruval007

You can always give [LINQ to XML](http://msdn.microsoft.com/en-us/library/bb387098(v=vs.100).aspx) a try. Another options is to read the XML file with the [System.Xml.Linq.XDocument.Load()](http://msdn.microsoft.com/en-us/library/bb358684(v=vs.100).aspx) or [System.Xml.XmlDocument.Load()](http://msdn.microsoft.com/en-us/library/w009fhk7(v=vs.100).aspx) method, locate the User node, and iterate through each of the Attempts nodes (checking dates and adding the Distance, Duration and number of nodes per Place). Give it …

Member Avatar for ChrisHunter
0
262
Member Avatar for will.penfold.71

What do you mean by unknown errors? Are you getting an exception, or is it giving you unexpected results? Give some more detail. Also, an example of your test input.

Member Avatar for jalpesh_007
0
161
Member Avatar for romiaujla

Any numeric literal preceeded by 0x indicates a [hexadecimal](http://en.wikipedia.org/wiki/Hexadecimal) (or base-16) value. Basically each digit represents a value from 0-15 (0-9 then A-F). It is useful because two hexidecimal digits represent exactly one byte (00, 01, ... fe, ff in hexadecimal is equivalent to 0, 1, ..., 254, 255 in …

Member Avatar for nmaillet
0
193
Member Avatar for sephyr.suspitsados

Take a look at the [DateTime](http://msdn.microsoft.com/en-us/library/system.datetime.aspx) struct. .NET does not have a class/struct that only represents a date, so it'll use a DateTime with the time set to midnight. So you can use [ToShortDateString()](http://msdn.microsoft.com/en-us/library/system.datetime.toshortdatestring.aspx), [ToLongDateString()](http://msdn.microsoft.com/en-us/library/system.datetime.tolongdatestring.aspx) or [ToString(String)](http://msdn.microsoft.com/en-us/library/zdtaw1bw.aspx).

Member Avatar for nmaillet
0
167
Member Avatar for anisha.silva
Member Avatar for anisha.silva

Queue's are not thread safe, so you should be using locks. Pretty sure I gave you an example in a previous [post](http://www.daniweb.com/software-development/csharp/threads/434677/active-pipe-filter-in-c#post1867754). Was there anything about it you didn't understand?

Member Avatar for anisha.silva
0
1K
Member Avatar for anisha.silva

You end a Thread by returning from the method specified in the Thread constructor.

Member Avatar for anisha.silva
0
285
Member Avatar for jerlisacoleman

> take it up with the authorities at your school or college I hope your joking. The last thing most people need in school, is a professor with a chip on their shoulder.

Member Avatar for NathanOliver
0
363
Member Avatar for anisha.silva

I think you have it backwards... The string should be the key in this case (i.e. `SortedDictionary<string, int>`), since there is a one-to-many relationship between the key and the value. If you did it with `SortedDictionary<int, string>` you could never have words that equal the same amount.

Member Avatar for anisha.silva
0
233
Member Avatar for tboctavan

You're comparing to variables `empName` and `Quit`. I don't see a variable called `Quit` declared anywhere. If you wanted to compare it to the string "Quit", then it would look like this: if (empName != "Quit") { ... } Note that it is case-sensitive. If you want to ignore case, …

Member Avatar for tboctavan
0
108
Member Avatar for sundog1

Are you getting an exception? That would be helpful to have. At a quick glance, try adding the row `oDetailRow` to the table before calling `SetParentRow()`.

Member Avatar for nmaillet
0
256
Member Avatar for plasticfood

Did you try: Something<K, V>[] s = new Something<K, V>[size]; That's assuming the other class is generic, and has K and V defined. If not, you need to explicitly declare it, like so: Something<string, int>[] s = new Something<string, int>[size];

Member Avatar for plasticfood
0
219
Member Avatar for Dendei

There's also the `Leave` event; it's fired when the TextBox loses focus. Just keep in mind, that if you have an `AcceptButton` set and the user presses <Enter>, the `Button.Click` event will fire, but the `Leave` event will not (since it never really loses focus). You may want to even …

Member Avatar for Dendei
0
356
Member Avatar for ail swati

You'll have to poke around the registry for that. You can use [RegistryKey.OpenRemoteBaseKey](http://msdn.microsoft.com/en-us/library/dd411618(v=vs.100).aspx) to access a remote registry. There are some conditions to using it; they are discussed in the provided link. There could be some security risks with this however. You could also install a client application/service on the …

Member Avatar for nmaillet
0
121
Member Avatar for ZER09

C# doesn't work this way. `using` is only intended to have the compiler imply the namespace of a class. IMO, this would make your code difficult to read, as another programmer would have to search for the particular class the method is defined in.

Member Avatar for nmaillet
0
271
Member Avatar for anisha.silva
Member Avatar for javanub123

See [here](http://msdn.microsoft.com/en-us/library/ms366768(v=vs.100).aspx). Basically, you subscribe to an event like so: comboBox.SelectedIndexChanged += comboBox_SelectedIndexChanged; and you can unsubscribe from an event like so: comboBox.SelectedIndexChanged -= comboBox_SelectedIndexChanged;

Member Avatar for javanub123
0
251
Member Avatar for DelilahDemented

> Is this where RunSQL() should go? Yup. > How does it determine if the progress has changed? You use the `BackgroundWorker.ReportProgress()` method; that is, you explicitly update progress if you wish. You can get the instance of the `BackgroundWorker` by using the `sender` parameter. It is important to note …

Member Avatar for nmaillet
0
565
Member Avatar for gelmi
Member Avatar for Dendei

You could do it in the constructor: public class Customer { private readonly string Name; private readonly string Phone; private string Number; public Customer(string name, string phone) { if (string.IsNullOrEmpty(name)) throw new ArgumentNullException("name"); Name = name; ... } } FYI, the purpose of `readonly` is to prevent the value from …

Member Avatar for nmaillet
0
183
Member Avatar for anisha.silva

This seems very similar to your [last post](http://www.daniweb.com/software-development/csharp/threads/434428/read-from-txt-file-using-threads). In either case, show your code, and explain how you want it broken up.

Member Avatar for nmaillet
0
601
Member Avatar for nIcks123

> Sorry about that.. here's the code.. You're code is still wrong, the OP said nothing about restricting symbols... Please stop, a quick, clean, readable and correct solution has already been offered; your solutions offer very little of that.

Member Avatar for Reverend Jim
0
206
Member Avatar for colombn4life

Ok, a few things: 1. When calling a function, you do not need to define the type of the parameters. For insatnce, on line 42, you would use `PlayGuess(solution);`. 2. On line 65, you try to declare a variable called MAXGUESSES. This is alreay defined on line 3. The compiler …

Member Avatar for WaltP
0
251
Member Avatar for NoUserNameHere

That's a good start, but I wouldn't think it would be enough (FYI, I'm more of an application developer and never interned). Client-side scripting (JavaScript) is still extensively used; however, many sites are using server-side scripting as well these days (e.g. PHP, ASP or ASP.NET). Also, AJAX really helped push …

Member Avatar for NoUserNameHere
0
124
Member Avatar for Dendei

A struct wouldn't save any "memory", it would pretty well be equivalent. Depending on the architecture of your system and how the compiler wants to handle it, all data in a struct would be passed on the stack, so it would probably be better to use a class. A class …

Member Avatar for Dendei
0
248
Member Avatar for ome2012

Take a look at the [MSDN article](http://msdn.microsoft.com/en-us/library/fk6t46tz(v=vs.100).aspx). And try this out: Sub Main() Try Try Console.WriteLine("Try") Throw New Exception("Try") Catch Console.WriteLine("Catch") Throw New Exception("Catch") Finally Console.WriteLine("Finally") End Try Catch ex As Exception Console.WriteLine("Exception: " & ex.Message) End Try Console.ReadKey(True) End Sub You get the following output: Try Catch Finally Exception: …

Member Avatar for ome2012
0
203
Member Avatar for gajoline.marascino

You are "printing" to two separate PrintStream objects (out and err). In your case, they both output to the same place (i.e. the console, or your IDE's output); however, they both use internal buffers that are dependant on the object. This is the same way files tend to work: data …

Member Avatar for gajoline.marascino
0
160
Member Avatar for ragonss

> 1 this takes as input any number right? Not quite, it takes a set of numbers. The while, indicates a loop that repeats as long as "read was successful". It's difficult to determine from the way your post is tabbed, but it probably loops after the "read number" statement. …

Member Avatar for Taywin
0
119
Member Avatar for //Gonz

You initializes one dimension of the 2D array. You need to initialize each element of that dimension, like so: TControls[t] = new Control[size]; This is called a jagged array, since each element of the first dimension can have a different length. FYI, C# also has a convention for a rectangular …

Member Avatar for nmaillet
0
218
Member Avatar for Trebron

It's exactly what the title of your post says it is. You need to give the SelectCommand property a command. Hint: SqlDataAdapter (adapter) has a SelectCommand property and you initialized an SqlCommand class (sqlCmd).

Member Avatar for nmaillet
0
546
Member Avatar for sid.khan.505

If you're specifically targeting Windows, you can use Visual Studio Express. If you want to support Mac and Linux as well, you'll probably want to go with MonoDevelop. There are a lot of IDE's out there, just Google it, same goes for quick tutorials on creating desktop applications.

Member Avatar for arunkumars
-1
204
Member Avatar for anisha.silva
Member Avatar for MattBerry

Hmm, that's interesting... When textBox1 loses focus, are you giving it to textBox2? I would imagine (but never tried it) that when a TextBox gains focus it would reevaluate the property. I'm on my cell, so i can't test anything at the moment. As for number 3 the handling of …

Member Avatar for MattBerry
0
207
Member Avatar for pilipino93

In what way does it crash? Is there an exception you are getting? I was able to run the program without it crashing. C# can, of course, open any type of file, it's just a bunch of bytes... Also, might I recommend you avoid using `var` that heavily. It has …

Member Avatar for pilipino93
0
263
Member Avatar for DevCa
Member Avatar for nmaillet
0
74
Member Avatar for Dili1234

First, you should be using the MdiChildren property, not OpenForms, and the event is not going to fire at the appropriate times (mainly on closing) for your purposes. I could go deeper into it, but I'd rather recommend you not add anything to an MDI container except MDI child forms …

Member Avatar for nmaillet
0
187
Member Avatar for imaan fatima

Are you using Windows XP 64-bit or Windows Vista 64-bit? It doesn't work for either one of them. Also, it uses the PC speaker, not the sound card, which could be disabled via the BIOS or a jumper on the motherboard. Try opening of the command prompt, type Ctrl+G and …

Member Avatar for nmaillet
0
70
Member Avatar for bobejoe
Member Avatar for ANKUR1806

You'll have to set the `gdiCharSet` in the `Font` constructor (or in the properties panel if you're using Visual Studio). Through some testing, it looks like 128, 129, 130, 134 and 136 work (I was testing with यह परीक्षण है।, which should be Hindi according to an online translator...). You …

Member Avatar for nmaillet
0
436
Member Avatar for complete

You'll need to add an explicit refrence to it in the XAML, kind of like `using namespace ... ;`. The MSDN has some documentation on this [here](http://msdn.microsoft.com/en-us/library/ms747086.aspx). Basically, you add it to the root element it like so: <Page ... xmlns:tk="clr-namespace:Silverlight.Windows.Controls.Toolkit;assembly=<assembly_name>" ... /> Where you'd replace <assembly_name> with the actual …

Member Avatar for nmaillet
0
287
Member Avatar for complete

Could you just use a line like: `runningcount[city]++;`? Quick test: Dictionary<object, int> runningcount = new Dictionary<object, int>(); object city = new object(); runningcount.Add(city, 3); Console.WriteLine(runningcount[city]); runningcount[city]++; Console.WriteLine(runningcount[city]); Console.ReadKey(true); This program outputs: 3 4 The indexer property can also be set, which allows you to change the value. Unless there is …

Member Avatar for complete
0
104
Member Avatar for Summer995

You convert guess to upper-case on line 77, and compare it to the "gameWord" on line 88, which is all lower-case. There's a few other things with your code that you should fix as well: 1. You initialize `boolArray` twice (line 16 and 22). 2. All elements of an array, …

Member Avatar for nmaillet
0
139
Member Avatar for ANKUR1806

You'll probably have to use COM with Word, aka Word Interop; here's the [reference](http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word(v=office.11).aspx). Note that this requires particular versions of Word to be installed on the client machines. I'm sure there are ways to determine and utilize the version at runtime, although I've never had the need to look …

Member Avatar for ANKUR1806
0
165
Member Avatar for Mr.BunyRabit

For something like this you may have to look at the PDF specification. There's also an Acrobat SDK and PDF Library SDK, both of which cost money, and I have no idea what they offer in terms of detecting corruption. From what I understand, 1.7 is the latest specification, although …

Member Avatar for hollystyles
0
4K
Member Avatar for rvijaya

It won't ever evaluate to false, but the break statement would handle this. The `matches()` method actually uses regular expressions, which is overkill in this situation. Did you use all caps, because the regex engine in case-sensitive by default? In either case, I would recommend using `inputName.equals()` or `inputName.equalsIgnoreCase()` instead …

Member Avatar for rvijaya
0
146
Member Avatar for sundog1

Did you assign a OleDbCommand to the OleDbDataAdapter's SelectCommand property? The command builder uses the SELECT query to construct other queries, such as the INSERT INTO query.

Member Avatar for sundog1
0
203
Member Avatar for Octet

Is this a personal or business plan through your ISP? In either case, you may want to look over your service agreement, as some prohibit users from setting up servers. Whether they monitor and enforce it, I have no idea.

Member Avatar for Octet
0
146
Member Avatar for uroz

@nesa24casa He said he can't use classes. Structs are essentially the same thing (minus the allocation on the heap), so I doubt he could use them. I ran a quick test with: string[] ret = RazvrstiPoVrsti("c:\\test.txt"); Console.WriteLine(ret.Length); for (int i = 0; i < ret.Length; i++) Console.WriteLine(ret[i]); Console.ReadKey(true); and it …

Member Avatar for AnnieCalvert
0
121
Member Avatar for timosoft

What have you tried? [String.Substring()](http://msdn.microsoft.com/en-us/library/system.string.substring(v=vs.100).aspx) and [Double.Parse()](http://msdn.microsoft.com/en-us/library/system.double.parse(v=vs.100).aspx) are probably good places to start.

Member Avatar for Nutster
0
209

The End.