Posts

Showing posts with the label visual-studio

Conversion from string “” to type Long is not valid

Image
Clash Royale CLAN TAG #URR8PPP Conversion from string “” to type Long is not valid How can I fix this error? I am updating this code from VB.06 to vb.net everything is working correctly except this line. And it is happening only when the order number is wrong 2 Answers 2 it depends on how you like to handle the error. you can wrap the line with if txtOrderQty.text <> "" then end if and let the code to continue. or you can issue a warning message before processing further. The string "" can not be converted to Long because it is not a number. "" Long You can use TryParse to convert the string to Long . If it can not be parsed then 0 is returned into the variable in the second argument ( orderQty ): TryParse Long 0 orderQty Dim orderQty As Long Long.TryParse("", orderQty) lblToBeScanned1.Text = (orderQty - lngUPC1).ToString() ...

Compare two files in Visual Studio

Image
Clash Royale CLAN TAG #URR8PPP Compare two files in Visual Studio I saw new comparsion tool in VS 2012 for comparing two files or two versions of file. I like it. But when I tried to find it I can't because I don't use TFS. Is there a way how can I just compare two files with builtin feature in VS but without TFS? Just as comment for further use: If you are working with vs2015, use this link: visualstudio.com/en-us/docs/tfvc/compare-files – Elnaz Apr 9 '17 at 12:08 Note this is still applicable for VS 2017. Hence, I have provided an answer how to deal with this issue comfortably. – Matt Aug 23 '17 at 15:47 ...

Service Reference error upon creation

Image
Clash Royale CLAN TAG #URR8PPP Service Reference error upon creation I'm currently having an issue with adding an OData service in a C# project. The service looks like this. My step by step process looks like this: STEP 1: Entering the OData URL STEP 2: After hitting OK, the following error pops up. STEP 3: Trying to update the service ----> Which results in following error. I can't seem to figure out what causes these issues. If anyone has any suggestions, please let me know. It would be greatly appreciated! 1 Answer 1 Instead of using the service reference with UWP. I used Ajax calls to get the data. Some of them weren't allowed in a Unity build. This is why I used tags to exclude scripts like this: #if (UNITY_EDITOR) ... your class/code ... #endif More information about this can be found by following this url. https://support.unity3d.com/hc/en-us/articles/208456906-Excluding-Script...

i cant code in my ENTIRE System, IDE

Image
Clash Royale CLAN TAG #URR8PPP i cant code in my ENTIRE System, IDE i have a BIG PROBLEM! that making me Mad! i cant type any code (i mean i cant use Auto-Completion) in any IDE! i tried Ctrl+space (not working) i tried changing my WINDOWS to 10, 7, 8...! (not working) i tried everything... plz help, its about 2 month and still nothing! i'm going mad :( this issue crippled me, i cant use (mono Develop for unity) or other IDE's like VS-Code, or VS 15, 17! i'm really frustrated... in advance: (sry for my bad english) (and THANK YOU... ) By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

C# Key Events - KeyDown

Image
Clash Royale CLAN TAG #URR8PPP C# Key Events - KeyDown I have a Windows Form Application. I want some functions to work with the space key. But when I press the space key, the function I want is not working and it goes to the next form. (I did KeyPreview = true) private void Form7_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Space) { IEyeTracker eyeTracker = EyeTrackingOperations.FindAllEyeTrackers().FirstOrDefault(); GazeDataStop(eyeTracker); } } 1 Answer 1 Because: 1- If you have buttons, ... keydown won't work as form won't have focus anymore 2-you must handle the keydown so that it is not passed to ohter controls Solution for 1: set KeyPreview property of your form to true KeyPreview Solution for 2: set e.Handled = true : e.Handled = true private void Form7_KeyDown(object sender, KeyEventArgs e) { e.Ha...

How to unit test classes within a WCF web service

Image
Clash Royale CLAN TAG #URR8PPP How to unit test classes within a WCF web service How can I get a unit test project in a (VS2015) solution for a WCF web service to use the same web.config file for its own app.config? I don't want to have to replicate all the settings that are in web.config in my app.config (and have to remember to keep them in sync). Thanks. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

New to Visual Studio - Can't see output

Image
Clash Royale CLAN TAG #URR8PPP New to Visual Studio - Can't see output I have to do a programming project for an optimisation class, that has to be written in C or C++. So I'm trying to figure out Visual Studio 2015. I created a blank project, and opened a new C++ file, where I have the following: #include <iostream> int main() { cout >> "Hello World!/n"; cin.get(); return 0; } When I run it, I get a large blank white popup, and nothing else happens, even if I hit various key on the keyboard or wait for several minutes. It looks like this: If I close the large popup, nothing happens. What Visual Studio refers to as output from build looks like this: 1>------ Deploy started: Project: LinearProgramming, Configuration: Debug Win32 ------ 1>Updating the layout... 1>Deployment complete (157ms). Full package name: "53acc796-5708-4314-9034-f2a1f840a4f4_1.0.0.0_x86__eazt3av84y7ym" ========== Deploy: 1 succeeded, 0 failed, 0 skipped =...

Error CS0246: The type or namespace name 'WebDriverWait' could not be found?

Image
Clash Royale CLAN TAG #URR8PPP Error CS0246: The type or namespace name 'WebDriverWait' could not be found? I am new to creating tests in visual studio using selenium and C#. I have two files, one is search engine maing page and the other is a testing file. The files can be found here---https://www.automatetheplanet.com/page-object-pattern/ I always get this error; Below are screenshots of the problem. Error CS0246: The type or namespace name 'WebDriverWait' could not be found? What am I doing wrong?? below is the following code- using Microsoft.VisualStudio.TestTools.UnitTesting; using OpenQA.Selenium; using OpenQA.Selenium.Firefox; [TestClass] public class SearchEngineTests { public IWebDriver Driver { get; set; } public WebDriverWait Wait { get; set; } [TestInitialize] public void SetupTest() { this.Driver = new FirefoxDriver(); this.Wait = new WebDriverWait(this.Driver, TimeSpan.FromSeconds(30)); } [TestCleanup] public...

Input string was not in a correct format error while saving data from GridView to database [duplicate]

Image
Clash Royale CLAN TAG #URR8PPP Input string was not in a correct format error while saving data from GridView to database [duplicate] This question already has an answer here: I am trying to store my gridview into a database but I can't seem to do it. How should I solve it? foreach (GridViewRow row in gv_CartView.Rows) { int quantity = Convert.ToInt32(row.Cells[2].Text); Session["Quantity"] = quantity; decimal TotalPrice = Convert.ToDecimal(row.Cells[4].Text); Session["TotalPrice"] = TotalPrice; string queryStr = "INSERT into Cart (prod_Id,prod_Name,qty,prod_Price,total_Amt)" + "values (@ItemID,@Product_Name,@Quantity,@Product_Price,@TotalPrice)"; SqlConnection conn = new SqlConnection(_connStr); SqlCommand cmd = new SqlCommand(queryStr, conn); cmd.Parameters.AddWithValue("@ItemID", row.Cells[0].Text); cmd.Parameters.AddWithValue("@Product_Name", row.Cells[1].Text); cmd.Parameter...

Target .NET Framework 2.0 (not .NET Core 2.0) with Visual Studio 2017

Image
Clash Royale CLAN TAG #URR8PPP Target .NET Framework 2.0 (not .NET Core 2.0) with Visual Studio 2017 I want to contribute to Open Hardware Monitor, which uses .NET Framework 2.0 (again, it is not .NET Core 2.0). When I clone the repo and open the solution file, Visual Studio 2017 says I have to download some sort of "targeting pack" in this url. However, I cannot find the option to download .NET Framework 2.0. (the minimum version is 3.5 SP1.) How can I target .NET Framework 2.0 with Visual Studio 2017? I don't want to download and install older versions of Visual Studio. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.