166 Archived Topics
Remove Filter So it's early and I always have anxiety over things like this, so I was hoping someone could take a quick look and make sure this would actually work. I've got a socket program that will transmit a Data object over the wire. I just want to make sure that … | |
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? | |
I am in desperate need of some guidance here. Any suggestions or ideas would be very much appreciated! Is it possible to have a relationship based on two columns? For example: The table "Parents" has columns: ParentID (PK) The table "Children" has columns: ChildID (PK) ParentID The table "Addresses" has … | |
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 … | |
I don't know how to title this thread, forgive me if it's bad. I'm trying to determine the best way of handling this and I'm getting nervous about it. The basic setup I have is a server system that is run when the application is open (it's not a service, … | |
Quick (really) question about windows services. According to the documentation, services require a minimum of 2 methods OnStart() and OnStop() to be useful. OnStart() cannot contain the main execution code, it shouldn't loop, block or otherwise prevent the OnStart() method from returning quickly. The Question: If the above is true...it … | |
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 am putting together an editor for an application I am creating. The data ultimately resides on a SQL server. The application loads some of the data from the server into a dataset, which is used by a bindingsource which is then used by a bindingnavigator. (wow that's a mouthful). … | |
If I add an imagelist control to my project it asks me to select images from the hard disk. When my application is compiled and distributed are the images I selected serialized and/or compiled into the exe? or do the images need to reside on the end-user computer in the … | |
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 … | |
I can't figure out what I'm doing wrong here. I want to allow the user to name the database on their own. Can you use parameters in a situation where the command is simple like: [CODE=SQL]CREATE DATABASE @DatabaseName[/CODE] I've been trying forever and it just keeps creating a database called … | |
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 … | |
Not sure if this actually qualifies for this forum so please by all means move this topic to the appropriate place if it isn't. I'm writing a C# Windows Application (not a web app) and it uses either an SQL or Access database to store its data for multiple network … | |
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 … | |
Ok...I spent hours (I know, probably something you pros know already) trying to figure this out. I finally did and thought I would share it with others considering I found nothing (literally) out there on this. Feedback would be much appreciated! Most of the time string data written to a … | |
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 … | |
Maybe this is more of a "how do you report progress" topic. I have a progress bar on a form. The same form launches 2 separate threads. I would like each thread to report to the same progress bar. Instead of cluttering my code up with a bunch of stuff … | |
I have been reading through a rather lengthy Microsoft document regarding UX (User eXperience) design and standards. There are many great suggestions that I have started to adopt. But something occurred to me last night while working on my solution and I wanted to solicit some ideas and possibly have … | |
Having a problem here...not sure if it's something simple or not. I'll be honest, threading is new to me so I'm not quite sure what the problem is here. Let me explain the problem first and then I'll post some code. I have a method that runs in a wizard … | |
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 am working on a software project that utilizes the MSSQL Express version. My question is... I have checked out software that does the same thing that I want to do, but it seems that the competition uses a file based database system. I intend to use SQL because it … | |
Hi! I was wondering if anyone knew a way to have a date/time picker only allow the selection of months/years? Like January, 2010...etc and not the specific day of the week? Kinda like the attached image. | |
I'm getting to a point in my project where functionality can be based on the needs of individual users. As part of my application I would like to have the ability to add and remove functionality based on the user. I figure plug-ins might be the way to go for … | |
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... … |
The End.