visual-c#-express-2010

Database Connection Error “file in use”

耗尽温柔 提交于 2019-12-01 17:38:33
I am using Visual Studio 2010 C# Express and SQL Server Management Studio with SQL Server 2012 I am getting an error when I try to connect a database to my Windows forms project. "This file is in use. Enter a new name or close the file that is open in another program" I poked around online to try to find a solution but none worked. So i decided to create a brand new database and a brand new project. But I still get the error! here are the steps I use: First I connected to my locally hosted server then i right-clicked on Databases and selected New Database and named it school then i right

Database Connection Error “file in use”

痴心易碎 提交于 2019-12-01 16:31:38
问题 I am using Visual Studio 2010 C# Express and SQL Server Management Studio with SQL Server 2012 I am getting an error when I try to connect a database to my Windows forms project. "This file is in use. Enter a new name or close the file that is open in another program" I poked around online to try to find a solution but none worked. So i decided to create a brand new database and a brand new project. But I still get the error! here are the steps I use: First I connected to my locally hosted

How to call user defined function in LINQ in my visual C# web service for my android application?

北城以北 提交于 2019-12-01 09:30:54
I am currently working on an application that will retrieve other users' locations based on distance. I have a database that store all the user location information in latitude and longitude. Since the calculation of distance between these two pairs of latitude and longitude is quite complicated, I need a function to handle it. from a in db.Location.Where(a => (calDistance(lat, longi, Double.Parse(a.latitude), Double.Parse(a.longitude)))<Math.Abs(distance) )) {...} However, I got the following error: LINQ to Entities does not recognize the method and this method cannot be translated into a

Listing Only SubFolders In C#?

风格不统一 提交于 2019-12-01 01:00:38
问题 I have some code: string pathUser = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); string pathDownload = Path.Combine(pathUser, @"documents\iracing\setups\"); DirectoryInfo dinfo = new DirectoryInfo(pathDownload); // Populates field with all Sub Folders FileInfo[] Files = dinfo.GetFiles("*.sto"); foreach (FileInfo file in Files) { listBox2.Items.Add(file.Name); } I want the subFolders of: documents\iracing\setups\ to be shown, not the files...including the .sto files. All i

The conversion of a varchar data type to a datetime data type resulted in an out-of-range value error

ぐ巨炮叔叔 提交于 2019-11-29 15:30:50
The conversion of a varchar data type to a datetime data type resulted in an out-of-range value error I'm trying to enter data into my table using a form, the date formats in both the form validation and the sql server are both dd/mm/yy, however when i try to submit data from the form with a day higher than 12 (e.g. 13/12/2012) it throws an exception whose cause is "The conversion of a varchar data type to a datetime data type resulted in an out-of-range value error", and if i try to enter data into the form in a mm/dd/yy format it states "wrong date format" which is suppose means that the dd

Reference disappear upon debug/build (C#, VB.NET, VS2010)

元气小坏坏 提交于 2019-11-29 12:04:53
问题 I am using the MagicLibrary for a few components. I knew it was written in Visual Studio 2003 and recompiled it in Visual C# Express 2010. It compiled just fine and I could see the library in the folder. I then created a new project in Visual C# Express 2010 and added the components MagicalLocalLibrary.dll to the Toolbox. They appeared fine with no errors. I put in a control from the Toolbox to my form, and it seemed fine. I then debugged (to see if any errors would occur) and I saw that the

Running a .exe application from Windows forms

不想你离开。 提交于 2019-11-29 06:52:38
I have an application that I run in the command prompt as follows: C:\some_location>"myapplication.exe" headerfile.h I want to create a Windows form application where the user can specify the location of the executable and also the header file so that the windows form can do this for him and the user wouldn't have to go to the command line and do it. I'm very new to C#, so can anyone please help me out? Thank you! You need to use the Process class: Process.Start(@"C:\some_location\myapplication.exe"); For arguments: ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName = @"C:

WPF Application still runs in background after closing

前提是你 提交于 2019-11-28 23:01:42
This is slightly related to the question asked here yet the answer does not apply to my case as I am not using threads: WPF Not closing properly I have converted one of my WinForm application to a WPF application, nothing drastic needed to be done except for change a few words to the WPF/C# 4.0 equivalents (MessageBoxButtons to MessageBoxButton, why the one letter difference?). Anyway, if I run the application through the debugger it runs fine until I come to close it with the "X" button to the top right of the window. The application window closes but I noticed that the debugger still shows

Change “Visual Studio 2010” folder location

无人久伴 提交于 2019-11-28 18:45:22
I would like to change the "Visual Studio 2010" folders location to my Dropbox folder, so it gets synced every time I make a change. I have searched on the internet, but haven't found a solution yet. Is it possible to change the "Visual Studio 2010" folders location from within Visual Studio 2010, specifically Visual C# Express 2010? Tools > Options > Projects and Solutions > General > "Projects location" setting. Change the others too if you routinely create templates. If you want to relocate everything in the Visual Studio 2010 folder, it takes a couple steps: In Visual Studio, go to Tools >

How do I fix an “Invalid license data. Reinstall is required.” error in Visual C# 2010 Express?

做~自己de王妃 提交于 2019-11-28 05:46:57
I've tried to install Visual C# 2010 Express edition onto my PC, but whenever I try to run it, I get a error message. Invalid license data. Reinstall is required. I've already tried reinstalling it, and the message persists. OS is Vista Home Premium. I already have VC# 2008 Express installed. This worked for me on Vista. It's based on work-around at MS: http://connect.microsoft.com/VisualStudio/feedback/details/520110/invalid-license-data-reinstall-is-required Download subinacl command line tool http://www.microsoft.com/downloads/en/confirmation.aspx?FamilyID=e8ba3e56-d8fe-4a91-93cf