visual-studio-2012

Connection to SQL Server Database inside Visual Studio 2012 C#

笑着哭i 提交于 2019-12-24 00:49:34
问题 Forgive me if this is easy and I have seen similar posts but I am new-ish to C# and have been struggling on this, so any help would be much appreciated. I am trying to connect to a local DB SQL Server in Visual Studio 2012 but so far have had no luck. I got my connection string from the properties of my local DB which in the picture is in the left hand pane. public void connection() { string connectionString = "Data Source=(localdb)\v11.0;Integrated Security=True;Connect Timeout=15;Encrypt

Entity Framework Issue in VS2012 - Rename Properties not Sticking

为君一笑 提交于 2019-12-24 00:42:12
问题 I was attempting to create a new project in VS2012 with an Administrative MVC4 project, Website MVC4 project, and a Common Entity Framework dll project. I used an existing database an database and generated my entities from it. I updated the names of some of the relation properties and saved. I then added references to the Entity Framework project to both of my MVC4 projects, copied the Entity Framework connection string from App.config fileto each of the Web.config files, and made sure I was

Insert, Delete or Update cannot be performed?

让人想犯罪 __ 提交于 2019-12-23 23:53:11
问题 My query seems to be correct but why is this happening? OleDbConnection con = new OleDbConnection(); con.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Sparrow vivek\Documents\Billing.accdb"; con.Open(); DateTime a = Convert.ToDateTime(label2.Text); String query = "INSERT INTO balancesheet (BillNumber,CusName,Date,Amount) values (?,?,?,?)"; OleDbCommand cmd = new OleDbCommand(query, con); cmd.Parameters.AddWithValue("?",label3.Text); cmd.Parameters.AddWithValue("?

Get Windows Version

自闭症网瘾萝莉.ら 提交于 2019-12-23 23:30:55
问题 How can I accurately detect the current Windows operating system on a native (C/C++) project in Visual Studio 2012.3 for operating systems past Windows 8.1? I've looked in to VersionHelperAPI under MS recommendation, but this solution only applies to VS2013. Previously we used GetVersionEx() , but I'd like a solution that is more stable and future-proof in a way. It seems like MS is planning to deprecate this in the future. 回答1: The important thing is to include compatibility flags in

Visual Studio Javascript Intellisense - options object

允我心安 提交于 2019-12-23 23:16:27
问题 I'd like to get Intellisense support in Visual Studio for the options objects I use in my method calls. It's common to configure a call to a function in Javascript with a catch-all options object - for example jquery's Ajax call uses: $.ajax(settings); Where settings is just an object like: $.ajax({ url: '/blah', data: { stuff: 1 }, method: 'POST', // etc }); Although it's an implicit object, the properties follow a specific class. Typically when you have something like this that's important

How do I check which changeset my workspace is in

十年热恋 提交于 2019-12-23 21:31:40
问题 In Team foundation server, In order to analyze a bug that is currently in production, I used the "get latest version" functionality to get the changeset that was active in production so that I could run my unit tests against it. I want to double-check which changeset I got just to make sure that I actually did get the correct version of source code. Is there an easy way to do this with tfs? 回答1: If you bring up the file/folder in Source Control Explorer, right-click and go to Properties it

Root element is missing when trying to Publish

久未见 提交于 2019-12-23 21:12:10
问题 It has been a while since I've published my app to Azure. During that time frame, I've upgraded my system from 32-bit to 64-bit meaning a fresh install of Windows and Visual Studio. And Visual Studio Update 3 came out and was applied. When I went to publish an update today, I received the following: The following exception was thrown trying to publish: Root element is missing. My web.config file looks fine so I don't think it's this issue. The app works fine in debug mode so I don't think it

Compile C in Visual Studio 2012 without MSVCRT runtime

南楼画角 提交于 2019-12-23 20:32:16
问题 Visual Studio 2012 (and earlier versions) are capable of compiling C code. Plain C , not C++. It would be a good feature if you wanted to avoid the runtime hazzle. I thought of compiling plain C binaries and was hoping to do so without the MSVCRT runtime. After adding the /TC (compile as C) option I was hoping to get a binary with only basic dependencies such as kernel32 and ntdll. But instead, this was linked: We want to use VS 2012 and not the runtime. The GCC compiler doesn't need it, so

Visual Studio “rename” refactoring

半世苍凉 提交于 2019-12-23 20:21:54
问题 At the moment I have to write C# code in VS2012, (Before was: Java (Eclipse, IDEA)). May be I am strange guy, but I like when class name == class file name. Why in VS2012 no option to rename class file same as I renaming class name ? (Or I could not find it) I know that C# compiler do not care about matching class name and class file name, but I want to do it. I can`t find class by its file name if they are not same, it is annoying me very much aaaargh. Help me please, I'm tired finishing

API to modify the machine.config file - 'DbProviderFactories' section can only appear once per config file

女生的网名这么多〃 提交于 2019-12-23 20:08:44
问题 I've recently encountered the following error on a client machine: The 'DbProviderFactories' section can only appear once per config file. It appears that the machine config contains a duplicate DbProviderFactories element. <system.data> <DbProviderFactories> <add name="IBM DB2 for i .NET Provider" invariant="IBM.Data.DB2.iSeries" description=".NET Framework Data Provider for IBM i" type="IBM.Data.DB2.iSeries.iDB2Factory, IBM.Data.DB2.iSeries, Version=12.0.0.0, Culture=neutral, PublicKeyToken