c#,visual-studio-2012,sql-scripts,run-scriptRelated issues-Collection of common programming errors
vasa911
c# ftpwebrequest
I’m making a FTP client and trying to upload file to server (~300 Mb), but i get following error when nearly 100 Mb of the file were transfered:The underlying connection was closed: An unexpected error occurred on a receive.Here’s my code:private void UploadFile(string filepath, string filename){try{FtpWebRequest ftp = (FtpWebRequest)FtpWebRequest.Create(“ftp://” + server + “/” + filename);//ftp.KeepAlive = false;//ftp.Timeout = 1000000;//ftp.UsePassive = true;//ftp.ReadWriteTimeout = 100000;Pat
Eray Geveci
c# asp.net sql
Possible Duplicate:Unexpected database output when using INNER JOIN hello i have a sql query like this:SELECT DISTINCT r.BEZEICHNUNG AS BEZEICHNUNG, r.ID AS ID, ra.BEZEICHNUNG AS raumBEZEICHNUNG, ra.ID AS raumID FROM RAZUORDNUNG rz right join RAUMATTRIBUTE ra ON rz.RAUMATTRIBUTE_ID = ra.ID right join RAUM r ON rz.RAUM_ID = r.ID WHERE ….i write the results in a list: strasseObject.Add(new RAUM(){RaumName = rdr[“BEZEICHNUNG”].ToString(),RaumID = rdr[“ID”].ToString(),RaumAttribute = rdr[“raum
Diana Dimitrova
c# asp.net-mvc-3 wcf
When i try to access web service from the development server, it returns the error below. When I access the same service from my local machine, it works fine. Do you have idea what might be the reason? Thank you very much in advance!System.ServiceModel.ProtocolException: The remote server returned an unexpected response: (405) Method Not Allowed. —> System.Net.WebException: The remote server returned an error: (405) Method Not Allowed.at System.Net.HttpWebRequest.GetResponse()at System.Serv
Jez
c# .net exception error-handling
It’s often said that you shouldn’t use exceptions for regular error handling because of bad performance. My guess is that that bad performance is caused by having to instantiate a new exception object, generate a stack trace, etc. So why not have lightweight exceptions? Code like this is logically sound:string ageDescription = “Five years old”; try {int age = int.Parse(ageDescription); } catch (Exception) {// Couldn’t parse age; handle parse failure }And yet we’re recommended to use TryParse
agmcleod
c# .net
Solved.The string for the keyvalue pairList<KeyValuePair<string, string>> responses = new List<KeyValuePair<string, string>>();Is like so: 2011-6-8 2:19:0 || urlI sorted the List by using the following:responses.OrderByDescending(s => DateTime.Parse(s.Key.Split(new string[] { ” || ” }, StringSplitOptions.None)[0])).ToList();Thanks for the quick responses everyone.Problem:I have a list that contains a key value pair like so: List<KeyValuePair<string, string>>
kubal5003
c# garbage-collection
for some time I was trying to debug my algorithm that synchronizes data between two databases. Everything worked ok for a few months of everyday use and recently strange things started to happen eg:”DisableBuyButton” property was sometimes set to true, while this was explicitly set to false in the configuration file (I have stepped through the algorithm way too many times to find something odd – found nothing and while doing this on my machine everything was ok) products were assigned to differe
Yuck
c# sockets networking
This is related to c# Sockets. I’m developping a socket program. But there is one problem in my software. I cannot connect to computers which are connected to internet via theirs local network. But I can connect to computers that are uses internet alone. Be more descriptive, Consider that 5 computers connects internet via a modem that uses 1 ip address. When I try to reach one of these computers, API connects to modem via its ip address. But there is no response. Because a modem don’t respond
vince
c# excel
i have a situation where i load a dataset with excel file. All the worksheet are loaded as datatable with the appropriate worksheet name as datatable name. What i am trying to do is get this datatable value using column name. But i am not get error saying”Column ‘Execute’ does not belong to table Sheet1″.While loaded excel to datatabel i have used HDR=YES and IMEX=1. I also tried with HDR=NO. nothing is working. below code is to write excel to datatableforeach (Microsoft.Office.Interop.Excel
leppie
c# booksleeve
I am having difficulty with the 1.1.0.5 version of Booksleeve in VS2010 working the way I intend to use it. What’s happening is after perform and wait for an operation, Booksleeve sometimes leaves the connection in a closed state, so operations down stream throw exceptions.The simplest issue I am having is this:static void Main(string[] args) {Func<RedisConnection> getNewRedisConnection = () =>{RedisConnection conn = new RedisConnection(“Belasco”);conn.Error += (obj, eArgs) => { thr
apros
c# sql-server clr clrstoredprocedure
I have a stored procedure in SQL Server 2008 CLR project. This function call a console application with a parameter that contain some xml. [Microsoft.SqlServer.Server.SqlProcedure()] public static SqlInt32 ExecuteApp(SqlString utilPath, SqlString arguments, ref SqlString result) {ProcessStartInfo info = new ProcessStartInfo(“cmd.exe”);Process p = new Process();try{//ProcessStartInfo to run the DOS command attribinfo.RedirectStandardOutput = true;info.RedirectStandardError = true;info.UseShell
John Saunders
wpf visual-studio-2012
I’m experiencing a weird error with the visual studio 11 beta WPF designer (i.e. google does not return any results while searching for a part of the stacktrace)Here is the problem: When I create a WPF application project, and then add windows or usercontrols to it, I have no problems editing them in the embedded WPF designer. But when I create a WPF user control project, I cannot manage to get it working: I have the weird error I pasted below.I’m targeting .Net 4.5 … and my VS is in french (s
Junior Mayhé
entity-framework ado.net visual-studio-2012 code-analysis
In a MVC 3 solution, under VS 2012, it sounds strange that you receive such message after Running Code Analysis:It is strange because the class which is mentioned in the “DON’T” analysis was generated by VS itself (not me).To reproduce this you can:add ADO.NET Entity Data Model to your solution, add your database tables (already existent in SQL Server) to your diagram, rebuild solution, add Controllers and cshtml views (those ones are generated automatically). run the code analysis from ANALY
ctor
c++ visual-studio c++11 visual-studio-2012
I have this strange issue with strcspn() in Visual Studio 2012.When I compile the following code as a 32 bit Win32 console application I get the expected result of 6.#include <string> #include <iostream> #include <cstring>int main( int argc, char **argv ) {char delimiter_ = ‘,’;std::string css_ = “ESCAPE,,0,0”;printf( “%s\n”, css_.c_str( ) );printf( “%d\n”, strcspn( css_.c_str( ), &delimiter_ ) );size_t lengthOfField = strcspn( css_.c_str( ), &delimiter_ );printf( “%
Adam Drewery
git merge diff visual-studio-2012 git-extensions
So, I don’t know if anyone’s noticed but the new Merge Tool packaged with VS2012 is sick-o to the max. I’ve recently moved to Git for my source control and really want to be able to set up VS2012 as my default difftool/mergetool.Any suggestions as to how to do this? I’d rather the diff/merge is started in the active VS2012 window and not a new instance if possible.
gokhanartuk
asp.net-mvc-3 visual-studio-2010 asp.net-mvc-4 visual-studio-2012 dotnetopenauth
I am facing with very strange error in my project. I installed DotnetOpenAuth.Aspnet and Microsoft.AspNet.WebPages.OAuth libraries nuget packages. When I run the project there is no problem. But When I write the test for controllers it is throwing an exception like the following.Test method MvcApplication2.Tests.ControllerTest.should_return_not_empty_content threw exception: System.IO.FileLoadException: Could not load file or assembly ‘DotNetOpenAuth.AspNet, Version=4.0.0.0, Culture=neutral, Pub
Thiago
sql oracle visual-studio-2012 odt.net
I’m trying to connect a application to a Oracle database through VS2012 (most of times I use sql server). But when I try to create a new connection i get this error:An unexpected error occurred in the Oracle Data Provider for .NET. Please contact the provider vendor to resolve this problem.This thread already talk about this problem: Getting an Error when trying to connect Visual Studio application to Oracle I can successfully connect to the database using sql developer. And the connection seems
Maciej Kachniarz
visual-studio-2010 visual-studio configuration visual-studio-2012
I had Visual Studio 2012 and then I installed Visual Studio 2010. VS2012 is always working correctly but I have problem with VS2010. When I run template projects I have errors:error C1083: Cannot open include file: ‘iostream’: No such file or directory IntelliSense: cannot open source file “stdio.h” … and so onSomething has to be configured badly but I don’t know what. To fix it in Project properties/Configuration properties/VC++ Directories I add paths to VS2012 in include:C:\Program Files %2
neoscoob
visual-studio-2012 azure
I have a valid azure subscription, a cloud service created, storage account created, etc. It’s running my app just fine (manually packaged and uploaded). In VS 2012, if I right click my cloud project and select Publish, there is a link to “Sign in to download credentials”. I download the file, I import it, and it shows my subscription as expected. I click Next. I am then greeted with a horrifyingly unexpected dual dialog as shown here (attached)It cannot find any cloud services, despite the fac
Vasiliy Mazhekin
c# visual-studio-2012 microsoft-fakes
I have written very simple unit test project to see abilities of Microsoft Fakes. And I have executed on System assembly the menu command “Add Fakes Assembly”.public static class Y2KChecker {public static void Check(){if (DateTime.Now == new DateTime(2000, 1, 1))throw new ApplicationException(“y2kbug!”);} }[TestClass] public class UnitTest1 {[TestMethod]public void TestYear(){using (ShimsContext.Create()){ShimDateTime.NowGet = () => new DateTime(2000, 1, 1);Y2KChecker.Check();}} }But in line
U?osKo?
c# wpf wcf visual-studio-2012 ria
I have a silverlight application consuming data via RIA. Some methods are exposed in a way that they can be consumed in silverlight as well as in WPF application via Service Reference.On development, these services are called via localhost and everything works fine.I have set my hosts file so that it’s all available at subdomain.domain.com. Now (also after a couple of restarts) when I access .svc via different browsers, I get different responses in Chrome and in Internet explorer on the same URL
James Donnelly
java sql-scripts
I want to execute an SQL script file in Java without reading all file content into a big query and executing it. Is there any standard way?
Ozkan
mysql sql sql-scripts
I tried reading a very large MySQL script file with MySQL Workbench but it doesn’t react. Tried with a freeware app (HeidiSQL) but it crashes.Any idea how I can read it?
J. Steen
c# visual-studio-2012 sql-scripts run-script
I have a little problem about that. When i create a script with VS2012 ,it looks like that (DataBase Name : LSProjeDB and have a table as Musteri) (created like that : go table > update>genarete script >wow)GO SET ANSI_NULLS, ANSI_PADDING, ANSI_WARNINGS, ARITHABORT, CONCAT_NULL_YIELDS_NULL, QUOTED_IDENTIFIER ON; SET NUMERIC_ROUNDABORT OFF; GO :setvar DatabaseName “C:\USERS\YC\DOCUMENTS\LSPROJEDB.MDF” :setvar DefaultFilePrefix “C_\USERS\YC\DOCUMENTS\LSPROJEDB.MDF_” :setvar DefaultDataPath “C:\Us
J. Steen
c# visual-studio-2012 sql-scripts run-script
I have a little problem about that. When i create a script with VS2012 ,it looks like that (DataBase Name : LSProjeDB and have a table as Musteri) (created like that : go table > update>genarete script >wow)GO SET ANSI_NULLS, ANSI_PADDING, ANSI_WARNINGS, ARITHABORT, CONCAT_NULL_YIELDS_NULL, QUOTED_IDENTIFIER ON; SET NUMERIC_ROUNDABORT OFF; GO :setvar DatabaseName “C:\USERS\YC\DOCUMENTS\LSPROJEDB.MDF” :setvar DefaultFilePrefix “C_\USERS\YC\DOCUMENTS\LSPROJEDB.MDF_” :setvar DefaultDataPath “C:\Us
Web site is in building