Member Avatar

I have a string representing a date time, and a datetime local variable property. The string representing the datetime could be null or an empty string. To check for this, I thought I could check for a null or whitespace value and assign the appropriate value using this code: ReturnValue.ArrivalDate = string.IsNullOrWhiteSpace(Screenings.ArrivalDate) ? null : DateTime.Parse(Screenings.ArrivalDate); Pretty simple. The property `ReturnValue.ArrivalDate` is of the type `DateTime?`. So if the `Screenings.ArrivalDate` string is null or white space, it would assign the value `null` to the nullable `ReturnValue.ArrivalDate` property and if it's not null or whitespace, it would parse the string and …

Member Avatar
+0 forum 1
Member Avatar

I'm not sure if this is the right forum to ask this in, sorry if it isn't. It's been a while since I've been to this site. We have a MS SQL database that contains a table with some columns that are no longer used (or shouldn't be). The data isn't updated anymore and has been moved to different columns to extend functionality with the applications that access the data. Anyway, I would like to remove the columns, but I need to make sure that the ASP.NET website, an Access database and a C# WinForms application don't have any code …

Member Avatar
+0 forum 4
Member Avatar

I am working on a table that will hold batch data. The table will have a BatchDate column as a DateTime type. I'm considering adding a column for BatchYear as an integer and BatchPeriod (which could be a week number, a month number or a quarter number) as an integer, even though both of these values can be derived from the BatchDate and using another column in the table. I'm considering doing this because I'm thinking it would be easier to work with queries where someone doesn't have to pull the date from the table first, compute the period they …

Member Avatar
+0 forum 3
Member Avatar

I've asked this on SO *AND* Reddit without so much as a peep...was hoping DW would turn up the answer! I have an ascx user control that has a custom event added to it. I can get the event to work without problem, but the event doesn't show up in Visual Studio's property editor, only in intellisense. Is there an attribute I am missing or something? The event definition is: [Browsable(true), EditorBrowsable(EditorBrowsableState.Always)] public event EventHandler<EventArgs> SelectedIndexChanged; The event doesn't show up in the property box but all of my custom properties do: ![01.png](/attachments/large/2/d2100029f259ede79e25a6d88645611e.png "align-center") But is accessable through intellisense: ![02.png](/attachments/large/2/1606590fca35bd17c4dff6d7a4ec79ef.png …

Member Avatar
+0 forum 3
Member Avatar

The Membership table for our ASP.NET site has the encrypted passwords and password salts stored when a user logs in. The site is already served over an HTTPS connection, but we would like to give our clients the ability to download and save certain files and documents. We would like to have those documents encrypted (essentially password protected), which we can do, but, we would like to have them be able to open those enrypted documents using the password they use to login to the site. Is it possible to do this? Essentially, I don't see how it would be …

Member Avatar
+0 forum 7
Member Avatar

Hi everyone! I am in major need of some help here and before I go off and write a SP to handle this for me, I though I would ask here for advice first. I am writing a report to display on our asp.net site using the ReportViewer component and the report editor in VS. We have a SQL table that contains a DateTime field (two actually) and those fields also accept null values. The report I am writing in ASP.NET needs to select the data from the table and determine if the DateTime field is null to show certain …

Member Avatar
+0 forum 4
Member Avatar

Hi everyone! So we have a web application that some of our clients use to manage their account. Part of that means they can manage activities that their registered employees do. Right now we have a table that logs all of a customer's employees activities, even if they don't use the web application. We would like to add the ability to have our web application users add the outcome of the activity, notes, and other pieces of data (about 10 in total). The problem is that not all of our customers use the app so they wouldn't be adding this …

Member Avatar
+0 forum 1
Member Avatar

On our site we have a "News and Information" section at the top of our landing page. Right now it looks like this: ![news.PNG](/attachments/large/2/edb1aaabb260ba04b597c3a2f4a351b3.PNG "align-center") I'd like to change this to look something like the image below, but I'm having a hard time figuring out how to do this, or if it's even possible? I am using bootstrap CSS as much as possible, but I don't see anything like this in their documentation. Any thoughts or ideas would be GREATLY appreciated! ![news3.png](/attachments/large/2/5832e2c5b5d674c5e3381f713a77bd4e.png "align-center")

Member Avatar
+0 forum 5
Member Avatar

Good afternoon everyone! I'm running into a small snag and it could just be because it's late and I'm not thinking clearly. I have an ASP Panel that is an alert box. The panel's initial visible property is set to false and should only be set to true when specific events happen and my ShowAlert(string message) method is called. Everything works great except that when the page posts back the alert re-appears when it shouldn't. This is because the ShowAlert(string message) method sets the visible property to "true" but nothing ever sets it to false again. The alert box can …

Member Avatar
+0 forum 1
Member Avatar

If I implement an abstract class that contains this method: private void MyMethod(string awesomeParameter, int aBigNumber) { // something cool happens here! throw new NotImplementedException(); } can I change it to this without breaking the implementation? private void MyMethod(string myParam, int myInt) { // something cool happens here! throw new NotImplementedException(); } I can't seem to find an answer to this, and I've never run into this issue before, but I'm implementing a new MembershipProvider and the default implementation uses some logical parameter names, but they don't match our sql table schema. For example, the implementation uses "username" but our …

Member Avatar
+0 forum 3
Member Avatar

I am writing a custom MembershipProvider for ASP.NET and would like to record certain events in a table when they happen. I have the methods to do it, but I would like to get the value of the "ID" column of the row I insert into the table. I have the following method (which is obviously incomplete), but I'm not sure if it will work and I'm not in a place where I can test it yet, so I thought I would ask if this appears to be a valid way of retreiving the RecordID value. The SQL Query and …

Member Avatar
+0 forum 3
Member Avatar

Forgive me, but I've only really used WinForms in the past, and MVVM and WPF are new to me. For those who use MVVM with WPF, do you actually make separate directories (namespaces) for your Models, Views and ViewModels files or is it more of an abstract idea? I fundamentally understand what the MVVM process does, I just don't completely understand how it is truely implemented. For example: If we store our data in a SQL server, in a general respect, wouldn't that dataset be the Model? It certainly represents the data and how it is all related. A "model" …

Member Avatar
+0 forum 2
Member Avatar

I am starting a new application for our business to help maintain our client information, so it is going to be a very data driven application. I'm curious, from the standpoint of those who have used both and who may have constructive suggestions on the future direction of development, should the application be written in WinForms (which I am much more familiar with) or WPF (which I have been avoiding like the plague...XAML sucks!) Despite MY prejudice, I am willing to try to learn WPF and invest some time and money into it, but I would rather not if it …

Member Avatar
+0 forum 3
Member Avatar

Just a question on preference: Given a method that returns a boolean value, how would you write an If statement to check the return value of it? Like this? private bool MyMethod() { // doing stuff } private void OtherMethod() { If (MyMethod() == true) { // do stuff if true } else { // do stuff if false } } like this? private bool MyMethod() { // doing stuff } private void OtherMethod() { If (MyMethod()) { // do stuff if true } else { // do stuff if false } } some other way? Any reason why you …

Member Avatar
+0 forum 12
Member Avatar

I know the site switched to a tag system, and while I personally don't care for it, I like the community too much to find an alternative. Since I really only post to a single "tag" group, is it possible for people to have a favorite tags list we can create at the top of the screen? Scrolling to the bottom is a drag just for me to click "C#" and see relevant posts (relevant to me that is). Just an idea. :)

Member Avatar
+0 forum 3
Member Avatar

Good afternoon fine DaniWeb folks! I am about to pull my hair out on this one and I'd like to know if someone knows of a simple or obvious "gotcha!" for this problem. I've got a form with some detail fields on it (below) ![editor.PNG](/attachments/large/2/61f8ecd049dad3f28df2d6d98b522b69.PNG "align-center") When a user attempts to navigate off of the record shown, a method called "Save" is called, which prompts the user if they wish to save the record before it is changed. This is the text of that method (please forgive the rough code, it's very much a work in progress): /// <summary> /// …

+0 forum 0
Member Avatar

I would like to see a forum dedicated to UX/UI design. I know that a good application or website performs its job exceptionally well and the look and feel of the application doesn't affect, or shouldn't affect it's performance. But come on! It does. UX/UI design is more than just the color to use for a background and putting pretty pictures on the splash screen, it's also setting tab order, laying out controls in an easy to read and scannable fashion. It also encompasses when to use a new form compared to changing panel contents or when to open a …

Member Avatar
+0 forum 6
Member Avatar

I am trying to programatically create and dispose of file system watchers, but I am running into an issue when trying to dispose of them. When I try to use the code: // dispose of any existing watchers. foreach (FileSystemWatcher fileWatcher in this.Controls) { fileWatcher.Dispose(); } I am receiving a System.InvalidCastException exception. The details show: > {"Unable to cast object of type 'System.Windows.Forms.Button' to type 'System.IO.FileSystemWatcher'."} Which is obviously true, but I thought with the qualifier of FileSystemWatcher this would work by skipping over any controls that are not System.IO.FileSystemWatcher. Evidently not. Any suggestions? PS for the admins - When …

Member Avatar
+0 forum 3
Member Avatar

I'd like to suggest a forum category for Azure development. Many of the concepts are covered by the topics here, but some are not, such as Azure SQL Database, Virtual Machines and Virtual Networks, Cloud Services, etc... I know that some of those (VMs and VNs notibly) aren't really directly related to development of software or applications, but indirectly they are. There are tools and limitations that Azure offers developers that may be covered here, but they are scattered throughout the various forums. If we had an Azure Development section, and various subsections for the different Azure services, that would …

Member Avatar
+0 forum 1
Member Avatar

I'd like to propose that DaniWeb adds a new category of forums for Cloud development. The Software and Web Development might apply, but with the cloud being so versatile, you could technically do either Software or Web work on it. Just throwing that out there :)

Member Avatar
+0 forum 1
Member Avatar

I'm sorry if this is the wrong place to put this, but since I normally code in C#, and my potential solution would involve using C# I figured this would be the best place to start. I've been given a task at work to allow our customers the ability to transmit confidential record information from their office to our in-house, or possibly a new cloud-based, server. I have been rather adamint that to transmit said data, a SSL certificate must be aquired by us through a third party. But I'm wondering if that really is true. The more I researched …

Member Avatar
+1 forum 21
Member Avatar

Good morning! I was wondering if anyone could send me in the correct direction to locate documentation on how the Windows Sensor and Location Platform gets its data so that I can have a Windows service that will respond to GPS requests (without actual GPS hardware)? I'd like to have a Windows service that runs that will "fool" the Windows Location Provider into reporting to applications whatever location the user enters (GPS coordinates). I'm sure there are tools out there that do this, but this is more of just a learning experience for me. There's not much advantage (that I …

Member Avatar
+0 forum 2
Member Avatar

Good morning everyone! I haven't been here in a while, but I have a question that I thought someone here might be able to help with. When it comes to accessing data from a SQL server, I know the logistics of getting that data through code, no issues there, but is it safe (or rather, smart) to have your application interact directly with the SQL server? As in, not using a middle-man or an additional tier? I've toyed with N-Tier data applications and I find them highly annoying and complicated as well as convoluted. I know if you run SQL …

Member Avatar
+0 forum 2
Member Avatar

Good afternoon! I seem to disappear from this forum for a while then re-appear...I've been so busy with my first born baby girl that I haven't had time to check my email much less work on any of my projects, but something has come up and I need some input. I have an application that uses the built in random function to generate a random number. I'm wondering, if I need the result of the function to conform to a standard (namely being an integer, not a decimal) is it permissible to multiply the result by say 10,000,000 and then …

Member Avatar
+0 forum 5
Member Avatar

So I have a table I am trying to create, but as I am working on this, I am worried that the idea is flawed. Here's the SQL code to create the table so far: CREATE TABLE #ConversionLog ( EventTime DATETIME NULL, EventType NVARCHAR(20) NULL, RecordID INT NULL, EventTarget NVARCHAR(255) NULL, OldValue NVARCHAR(MAX) NULL, NewValue NVARCHAR(MAX) NULL, EventMessage NVARCHAR(MAX) NULL ) The Columns are defined as: * EventTime: The time of the log entry. * EventType: The type of action that occured, such as insert, update, delete, error, message etc... * RecordID: The primary key of the record that the …

Member Avatar
+0 forum 1
Member Avatar

Good morning strangers! I haven't posted in a while, but you always seem to be helpful... I have an application that uses SQL as a back-end to store data so that multiple users can access it at once. The question I have is, the requirements have changed and the SQL schema needs to change, and I'm not sure what the best way to do this is. I have a table that contains a "log" of sorts. Basically it allows us to keep track of tasks and indicate (via a boolean value) if the task was completed. So when the task …

Member Avatar
+0 forum 4
Member Avatar

Good afternoon! I am wondering if there is a way to log queries that have occured on a database or specific table? For example, is it possible to log the user, the query type (insert, update, delete, select, execute etc...), date, time, table, row and column(s) affected by the queries (if applicable) so that someone can in effect, "audit" our system? This isn't a web database, it's a local sql server on our intranet. Any suggestions or ideas would be greatly appreciated!

Member Avatar
+0 forum 1
Member Avatar

Out of curiosity, when you start a new solution and you add your first project to it, if it's a window's form application, you get a nice and neat form called "Form1" (how creative!). Do you rename that file? If so, what do you name it? If not, why? ![2f9411f0a0998da1589835c36807a955](/attachments/small/2/2f9411f0a0998da1589835c36807a955.PNG "align-left")

Member Avatar
+0 forum 7
Member Avatar

So I was playing around with Visual Studio 2010 and when I removed the Application.EnableVisualStyles() method from the Main() method, I noticed that the controls on the design surface don't change, they maintain their visual style, but when the application is run, it doesn't have the styles. Is there a way to disable visual styles on the design surface? I can't seem to figure it out. The closest I got was changing the OS theme. Seems kinda silly to try to design an application without Visual Styles and be forced to do it with visual styles enabled on your design …

Member Avatar
+0 forum 2
Member Avatar

There have been a total of 9 different versions of Visual Studio now going all the way back to 1995. My question is for those of you who use Visual Studio, how often have you upgraded your Visual Studio version? Going from 2005 to 2012 for example, not applying updates, but actually buying a different version?

Member Avatar
+0 forum 5

The End.