186 Topics
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 … | |
So I'm curious, when you need to store user settings or application settings what method do you normally use? I have been using a class and just serializing it to a file. But there is also the "settings" in the application's properties folder. Does anyone ever use that? Any pros/cons … | |
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 … | |
If I have 2 or more tables and I need to have another table that is related to the data in those tables...how would I achieve that? As an example: Table A and B have totally different data and aren't directly related at all. I would like Table C to … | |
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? | |
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... … | |
I noticed in the Advanced Properties of the connection string dialog, there is a setting for AttachDbFilename (see picture attached). The question is, in this case, the file resides on the E:\ drive of my local system. When the application is finished and deployed, will my application's connection string still … | |
I think I understand the general concept of how these files work, but I want to make sure, and ask a couple questions about them. Am I correct in thinking MDF files are "attached" to the SQL instance only as long as the application is running and are "detached" when … | |
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. | |
Just wondering if anyone has used, or played with any of the new Thread Safe Collections? [URL="http://msdn.microsoft.com/en-us/library/dd997373.aspx"]When to Use a Thread-Safe Collection[/URL]. Anyone found any real performance increases or no? Just curious. | |
I am still working on getting my socket server working. I would like to have the server keep the socket connection open until the client closes the connection or the server is shutting down. I have been using the example at [URL="http://msdn.microsoft.com/en-us/library/fx6588te.aspx"]MSDN[/URL] as a starting point. My question is though, … | |
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 … | |
I am building an async socket server to receive and process incoming commands. The model I am working on has the sockets receive the data and send it to a "Interpreter" class. I need a way for the interpreter class to know who sent the command to interpret to it, … | |
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 … | |
I don't think I've ever sealed a class before...would there be any benefit to sealing a public class that contains fields for a server to process? The object is sent over a network socket to the server, the server reads the data in the object and responds accordingly. I read … | |
[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 … |
The End.