111 Solved Topics
Remove Filter How do you personally organize your methods, event handlers (kinda the same), properties etc... in your classes? I've been grouping things by type using regions and then alphabetizing them within the regions, but I was just wondering what other people do if there is a standard? | |
I have an issue where two text labels are on the same horizontal line on a form. The label to the left expands to the right and down and is anchored to the bottom left of the form. The label on the right is anchored to the bottom right of … | |
Doesn't appear that a radio button has a value property other than true/false so I was hoping someone could help me out with this one. I'm writing a method applied to the "CheckedChanged" event. The method is applied to all of the radio buttons, so it always triggers regardless of … | |
I've done some research and it appears that Windows 7 is about tied with Windows XP users as far as current popularity (Vista seems to be a flop). My MSDN subscription includes access to multiple builds of various operating systems for "free" for development purposes. If my project is developed, … | |
I'm looking for suggestions on the best, and easiest way to install a Windows OS (in this case, XP, Vista and 7) on a hard drive, install my app., test it, make changes and then reinstall my app with a clean copy of the OS? Instead of sitting around going … | |
OK so I have a decent database that I have set up with all the correct tables and relationships, but now I have another issue, and that is distributing it. I don't know how to achieve what I am after. I know how to install SQL Server Express during my … | |
If I have SQL authentication enabled, and a user (UserA) on a database has permission to delete rows on TableA, but not TableB, and there is a relationship between TableA and TableB, can UserA successfully delete a record on TableA and have the changes (based on relationships set up) cascade … | |
So I'm plugging away at my database design and get to a point where I need to work on the UX (or UI for you old[er] peeps). I have a guide from Microsoft that I refer to very often called the UX Guide. I have all of my forms setup … | |
When I need to serialize things to a byte array I usually write the array to a MemoryStream first then use the binary formatter to serialize it to whatever (file, another byte array whatever). The question I had was, can I just serialize a byte array instead of converting it … | |
Is it possible to move the "description" column to the right of the "Allow Nulls" column in the table designer so you can see the descriptions for each table column without clicking through them one at a time? Like the attached picture? Please, someone, for the love of all that … | |
Can VS generate "junk" data in a database for testing purposes? I could swear somewhere I saw it in a menu, but I can't find it now? | |
If Server A and Client B are chatting through sockets, and Client B requests a dataset of all accounts on the server it has access to, the server provides that data set to the client (through serialization and sending it over the socket) and the client modifys the data, say … | |
I've seen many different answers to this...is it possible to have a constructor for a class that returns a value? | |
I know this makes no sense at all, but hear me out and maybe someone can supply me with some info on how this can be accomplished correctly. Using an invoicing type example. You have a table of clients who can receive invoices, a table of invoices with invoice numbers … | |
You guys are always so helpful, this is like my "go-to" forum for bizarre questions :P Not sure if this should be enforced by the SQL server or the Application itself. If we have a table with 2 columns of type int, ColumnA and ColumnB, is there a way to … | |
If my application was designed to generate a "schedule" or list of dates, and I wanted to store those dates in a SQL server as an array, what SQL data type would I pick? [COLOR="Red"]ntext [/COLOR]seems excessive, and I don't think [COLOR="red"]date [/COLOR]would work...any suggestions? | |
Still working to figure this stuff out :) My question is, is it possible to set a combination of columns with a unique constraint? For example: [CODE] ColumnA | ColumnB ----------------- Value1 | Value2 <- OK Value1 | Value1 <- OK Value2 | Value1 <- OK Value2 | Value2 <- … | |
Is it bad practice to create relationships between tables where the PK is an identity AKA auto incremented? The reason why I ask is, while identity keys won't repeat, they are set based on the order that someone enters data, so the first entry is 1, second is 2 etc... … | |
Need some help with this one. Is it possible to define a class constructor in an interface? I need to ensure that any classes that use a specific interface all have at least one constructor with specific parameters. Is there a different option that can yield the same outcome? | |
I haven't had enough coffee this morning yet and for some reason this doesn't look right. I have two objects that I need to convert into one byte array. One object is already a byte array, and the other is a Guid. Given that sockId is a Guid and commandData … | |
Anyone know if there are methods to alter the properties of files such as "Date Created" or "Date Modified" or even extended attributes such as an image file's "Star Rating" or tags, comments or even the Image ID? I attached some example images of what I am talking about. | |
Anyone know the rule for naming fields with the abbreviation "ID?" I notice that MS is inconsistent, they have "PlatformID" and "ApplicationId." I thought the rule was is the abbreviation was 3 characters or more, only the first letter is capitalized. Like Guid instead of GUID? | |
Is it possible to set a object's value, and once that value is set not allow it to change? I could write a method to do it, but I wasn't sure if there was some sort of modifier I could use? I need to set a value once, and not … | |
Looking at examples online, all of them seem to have: [CODE=C#]int read = s.EndReceive(ar); if (read > 0) {//Some code}[/CODE] The question I have is...why? Why bother with the [ICODE]if (read > 0)[/ICODE] when the MSDN says that EndReceive blocks until data is received? If you call [ICODE]int read = … | |
Does anyone know if you can use the comparison operators like ==, >=, <=, >, < etc... on two different System.Version objects to detect different versions and in what direction (like which of the two is a newer version vs older?) | |
I've been struggling with this for a while. It's not so much a "problem" as it is an approach. I've been working on my client/server socket program and I've reached the point in my planning (which isn't very far in) where I really need to think about how the server … | |
[COLOR="Red"]Disclaimer: [I]First, I'm aware that this is C++ code and this is a C# forum, I'm not all that familiar with C++ and was hoping someone here could explain the example below in C#.[/I][/COLOR] I was browsing the very complex source code of the open source project MySQL and saw … | |
Quick question: Is this valid, or am I missing a potential deadlock in the future: [CODE=C#] static readonly object _LockThis = new object(); private static bool _Status; private bool Status { get { lock (_LockThis) { return _Status; } } set { lock (_LockThis) { _Status = value; } } … | |
Any consensus? I see advantages and disadvantages to both. For a socket listener, a background thread would be good I would imagine, if the server is attempting to close, it obviously does not need or want to accept connections and any connection that is in the process of starting should … | |
If I start a new thread, and that thread executes a method that is contained in a referenced dll, how do they signal each other? Would this be considered a cross-process EventWaitHandle? It doesn't seem like it would be considering that the thread is started in the same process. I … | |
Is anyone aware of a way to do this? I considered adding a while statement to the listening loop of the server to evaluate if an integer is >= a certain value, and if so to enter another loop until it's not true, and that would allow the server to … | |
Greetings! Wondering if someone had some ears (or eyes I guess) I could bounce some concepts off of regarding a Client/Server system design. All technicalities aside (such as message framing etc..) I was wondering if anyone had ideas for how a system like that should be set up? Currently my … | |
If I have an internal class that implements an interface, the interface method must be public. Is that interface method visible to other assemblies or does the internal class that implements the interface prevent it from being visible? | |
I tried asking this at the MSDN website and didn't get an answer at all...I was hoping someone here could help. If I indicate that SQL Server Express is to be a pre-requisite for my application, how does the installer interpret this? For example: If end user A already has … | |
I am working on a project that stores it's data in serialized files on the hard drive in a custom file format. The server end of the application accepts TCP connections from clients and returns data to the clients based on the query, it's kinda like a light weight, custom … | |
I'm lost on this one. I'm creating a "Preferences" type form. On this form I have a tree view and a panel. I have created multiple user controls, each to be displayed in the panel when a certain tree node is selected. The problem I am having is finding the … | |
Is something like this possible: [CODE=C#] int MyParameter = 3356; DataTable x = new DataTable("CommandParams"); x.Columns.Add("ParamName"); x.Columns.Add("ParamType"); x.Columns.Add("Object"); DataRow y = x.NewRow(); y["ParamName"] = "@SomeParamName"; y["ParamType"] = MyParameter.GetType(); y["Object"] = MyParameter; SqlCommand z = new SqlCommand(); z.Parameters.Add(new SqlParameter(x.Rows[0]["ParamName"], (x.Rows[0]["ParamType"])x.Rows[0]["Object"]); [/CODE] I'm trying to come up with a method that can … | |
I have an application that, on occasion, might need to perform certain tasks on files, or other things that are "in-use" while the application in running. This is what I've tried to do, but I'm running into problems: I created an interface: [CODE] interface IShutdownCommand { void OnShutdown(); } [/CODE] … | |
Stupid question I know. But I have looked for HOURS on examples of how to do this. Every single example I can find uses streamwriter or streamreader which reads and writes text, not byte arrays. Is it possible to get a byte array from a CryptoStream? The closest I can … | |
I've got a question about navigating memory streams. Memory stream properties aside (like making sure the stream can use seek etc...) if someone is storing variable or dynamic data in a stream, how can you retrieve that data? Like, for example if a user could store an image from their … | |
I have a project that can potentially use a SQL server as a host for it's data. When a user starts the application for the first time, a wizard walks them through selecting how to store their data. If a user selects the SQL option and indicates that the database … | |
I am adding a feature to my application that allows users to backup an entire SQL database, as well as include application settings with that backup file. My dilemma is choosing a good file extension to use. The over-used .bkp type could cause conflicts in systems that have applications that … | |
Has anyone tried this? My general dilemma is having to open and maintain multiple connections across multiple forms. I have an MDI application and I would prefer to store the connection in the parent form and just have the child forms use that connection if it needs it. This normally … | |
For the past few hours I have been pouring through hundreds of internet articles, blogs and posts in various forums regarding interfaces. I get a general idea that it is basically a class with no implementation at all...a "skeleton" if you will. I was hoping for an a-ha! moment that … ![]() | |
I've been trying to figure this one out. I was under the impression that when a class method contains any resources, once the method has reached the end of the code and returns it's result (or nothing in the case of void), that all of those resources are gobbled up … | |
I have been reading through many blogs, the MSDN website, and Google search results trying to figure this out... At what point, or in what situations would someone ever want to have multiple projects under one solution? I have thought about having a project that contains forms and some "core" … | |
I have a timer that runs a SQL query every 30 seconds to retrieve updated information. Unfortunately every time the query runs the vertical scroll bar resets to the top most part of the form. I tried [CODE=c#] int scrollPosition = this.VerticalScroll.Value; [/CODE] at the beginning of the timer code … | |
All parenting jokes aside, I have a general purpose status strip on my parent form that contains a progress bar and a few labels. Occasionally a child form will execute a command that could be tracked on the status bar so my users don't think that the program is hanging... … | |
Does anyone use it? Seems kind of scary to me the thought that I would allow a mysterious command to alter data in my tables. Is it better to write your own update strings and execute them or use the command builder? Does it matter? Edit: PS the new site … | |
I have been working on a form that reads records from a SQL database. I have the binding working in that it populates all of the fields with the correct data. But if I am viewing record 1 and record 2 changes while I'm looking at 1, then browse to … |
The End.