2,157 Posted Topics
Re: No, you can't use it like a type, but you can use the Typeof(field) as a type. Not sure what you are really asking here, could you explain more what you are trying to do? | |
Re: 1) Add both assemblies to your project. 2) Right click the first assembly and select Properties 3) Change the Aliases field from 'global' to something else, like 'Version4000' 4) Do the same with the second assembly, but with a different alias, 'Version4030' 5) add these lines to the top of … | |
Re: [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.listbox.selecteditem.aspx"]ListBox.SelectedItem[/URL] | |
Re: You can create your GUI 'by hand' if you so desire. Open one of your GUI projects and take a look at the Form1.Designer.cs file (for example). That's the stuff you'll have to do to create a form and add controls to it. The Program.cs shows how you'd start up … | |
Re: ASP.NET is a web framework, not a programming language. So you don't program in ASP.NET. C# isn't a web based language. It's just a normal OO language that has a framework (ASP.NET) for writing web based applications. | |
Re: Take a look at [URL="http://msdn.microsoft.com/en-us/library/8he88b63.aspx"]DirectoryInfo.GetFiles[/URL], and the [URL="http://msdn.microsoft.com/en-us/library/system.io.file.aspx"]File[/URL] class. Depending on the size of the files you'll want to look at ReadAllLines and WriteAllLines. | |
Re: The OLE DB.NET Framework Data Provider uses positional parameters that are marked with a question mark (?) instead of named parameters. So you'll have to replace your @... with just ? and add the parameters in the order that they should appear. Look at the Remarks on [URL="http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbparameter.aspx"]MSDN[/URL] | |
Re: You are reading the database in two different ways. In the VB code, you fetch the entire table in a single read, then loop through the records. In the C# code, you are fetching single rows at a time, so you are making multiple calls to the DB. | |
Re: It's possible, but you'd have to provide all the stuff that IIS does for you, pretty much remaking IIS. | |
Re: Here is the code you need to look at:[code]double shipping_cost, distance,rate; distance = double.Parse(textBox2.Text); if (radioButton1.Checked) switch (listBox1.SelectedIndex) { case 0: rate = 1.0; break; case 1: rate = 2.0; break; case 2: rate = 2.5; break; case 4: rate = 3.0; break; } shipping_cost = distance * rate; [/code]The … | |
Re: [QUOTE=VasquezPL;1763074]I dont see much difference between both of them :/[/QUOTE] Then you need to go back and learn what an object is. And List<T> is for dynamic 'arrays' | |
Re: Mark them private. Only the object will be able to access them then. Other than that, there isn't anything you can do. I do wonder why you are so concerned that someone will call them. | |
Re: To shift rows you do this: Take row 1 and copy it to row 0. Take row 2 and copy it to row 1. Take row 3 and copy it to row 2. .... take row n-1 and copy it to row n-2. Take row n and copy it to … | |
Re: Go to this page [url]http://sourceforge.net/projects/sharppcap/[/url] Click on the Support link. Follow the instructions. | |
Re: Since you are using parallel arrays, it is important to have an index. This means you should use a for loop. | |
Re: I'd suspect it has something to do with the fact that < is the start of an HTML statement. Try convert it to < | |
Re: Add 1900 to the year.[code]DateTime date = new DateTime(1900+year, month, day);[/code] | |
Re: [code]using System; using System.Collections.Generic; namespace Testing { class Program { static void Main(string[] args) { int a = 11111111; List<int> index = new List<int>(); int pos = 0; while (a > 0) { if ((a & 1) == 1) { index.Add(pos); } a /= 2; pos++; } foreach (int i … | |
Re: Here is a generic split method that takes a character and an integer (n) and splits your string on every nth occurance of the character. Included is a little Main routine that tests it. [code]using System; using System.Collections.Generic; using System.Text; using System.Text.RegularExpressions; namespace Testing { class Program { static void … | |
Re: split the parts in your Linq statement instead of accepting the date as a whole value: [code]select new { c.content_Date.Day, c.content_Date.Month, c.content_Date.Year, c.content_Intro, c.content_Main, c.content_Title };[/code] | |
Re: Now that everyone has gone off track to your question :) You'll need to parse out the values from the string (as ints, strings, characters, whatever). You can then use Linq to get the union of the two sets, for example [code]String string1 = "1,2,3"; String string2 = "3,4,5"; String[] … | |
Re: During an update, SQL Server locks the resources in question with an exclusive lock, so they can't be read. From the documentation on transactions (italics mine): "BEGIN TRANSACTION starts a local transaction for the connection issuing the statement. Depending on the current transaction isolation level settings, [I]many resources acquired to … | |
Re: Your binding source should implement the [URL="http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged.aspx"]INotifyPropertyChanged[/URL] interface. Then you'll only need to subscribe to one event. | |
Re: First, why are you calling the Convert.ToDouble when you are getting it as a double? It's not needed. Second, if it says there is no data, there is no data. Put a breakpoint on the line and inspect the values and see if it is what you wanted. | |
Re: System.Data.Linq.Table is a generic type, thus you can't create an object of this type. You must provide the 'parameter' so the compiler can complete the generic class and make it a specific class. For example, you can't have a List<>, you provide a type with it (List<int>) and the compiler … | |
Re: [url]http://www.codeproject.com/Articles/18520/Vista-Core-Audio-API-Master-Volume-Control[/url] | |
Re: Triggers is how you would do this. If you are using SQL Server it is possible to write modules in C# that can be executed by the server. It would be easier just to have the client poll the DB for info. I do have to ask, though, why save … | |
Re: Only one thread in your program can actually interact with the GUI, and that's the problem you are seeing. If your child forms have heavy processing to do, you can spawn threads to handle that processing and when the thread is done, update the GUI. | |
Re: Do you know how to program in C#? Do you know how to use a database? Do you know how to create an audio 'fingerprint'? | |
Re: I can think of two reasons that you get these results: 1) The module isn't being loaded in 4.0 as the compiler is 'smarter' and it doesn't need to load it. 2) The module hasn't been loaded *yet*. The system is still in the act of loading modules when you … | |
Re: In line 24 of your second code block you are adding the event handler 'textBlock1_MouseEnter' to the MouseEnter event, but you don't actually have a method defined with that name anywhere that I can see, thus the error you are getting. Create the methods. | |
Re: You can also create your own certificate for testing purposes (or if the application is only used by your company). Example of doing this can be found [URL="http://en.csharp-online.net/Deploying_Windows_Applications%E2%80%94Sign_the_ClickOnce_Manifests"]here[/URL]. | |
Re: [B]return[/B] can also be used as flow control in methods, even void methods [code]public void TestMethod() { if (someStatus == true) return; DoOtherStuffHere(); }[/code] You use this to remove decision making from the calling method and placing it within the called method. This is useful when the information you need … | |
Re: Just like you'd call any other method. | |
Re: Just to clarify that, the + is the unary +, just like there is the unary - (for example, x = x + -1, x = x + +1). It's rarely used, as in I've never seen anyone use it :) | |
Re: [url]http://openwinforms.com/[/url] [url]http://www.viblend.com/products/net/windows-forms/controls/free-winforms-controls.aspx[/url] [url]http://dotnetkicks.com/winforms/Ascend_NET_Nice_and_FREE_WinForms_Controls[/url] Just do a search for free winform controls. | |
Re: [icode]SELECT DISTINCT a.ID FROM Contacts a, AccountsContacts b WHERE a.ID = b.ContactID AND b.AccountID NOT IN (<account id here>);[/icode] Should give you a list of all the contacts that are not linked to the specified account(s). | |
Re: I'm guessing that in his game he's fixed the bugs, but he hasn't posted the fixed code here. | |
Re: Problems with this code: It makes use of values that aren't declared or passed as values (the various textbox values). There is no error checking at all. It has bugs in it. I'll let you test your debugging skills. Just a quick glance over the code shows at least seven. | |
Re: What do you mean by compare? Execution time? That they do the same thing? That they have the same code? | |
Re: This is nearly two years old, I doubt they are waiting for your answer. | |
Re: The problem is caused by how the system looks for DLL files. It checks the location where the exe was started, the path, and the windows system directory. Since your DLL isn't located in any of these places, it can't find it. But you can register the DLL with the … | |
Re: Since the DateTime is nullable, you should check if it is null before your TotalLife calculation, then cast it into a DateTime. | |
Re: Use the built in function StrComp, as in "SELECT StrComp('hello', 'Hello', 0)". It will return 0 if they are the same, otherwise -1 or 1. | |
Re: Each user (and machine) has a key that is used by the API. The same key is used for anything that uses the Data Protection API. Not sure what private key files you are talking about. | |
Re: You'll need to send it, just like you are the file itself. Just send it first, then send the file. | |
Re: Check out the [URL="http://msdn.microsoft.com/en-us/library/system.speech.recognition.aspx"]System.Speech.Recognition[/URL] namespace. I used the API to speak xome words a long time ago and it seemed easy to use. | |
Re: This structure would be defined as [code][System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public struct CRYPT_ATTR_BLOB { /// DWORD->unsigned int public uint cbData; /// BYTE* public System.IntPtr pbData; }[/code] in C#. | |
Re: [url]http://wpftutorial.net/HowToCreateACustomControl.html[/url] | |
Re: [QUOTE=Ancient Dragon;1570850]Yes, it would be if it were written in C or C++ (and several other computer languages). But this is a math quiz, not a programming quiz. I don't recall ever seeing * meaning multiply until I started learning programming.[/QUOTE] I've seen #x used as a base indicator, so … |
The End.