Questions tagged as 'c#'

1
answer

FolderDialog in ConsoleApplication C #

I have a question regarding Console Application, how do I open a window similar to this one where it is possible to select a FOLDER? ItwouldbeafeatureequaltowhatexistsinWindowsFormswhere FolderBrowserDialog . I use the .NET Framework 4.5.   ...
asked by 18.06.2015 / 21:24
1
answer

Name editing is confirmed in the database but does not occur in the list

I am editing a database column and so far everything is fine, but when I load the table that contains this column using Include, it simply does not update the " Driver ", ID in the relationship but in the listing continues the name of the old re...
asked by 10.06.2015 / 22:07
2
answers

Conversion specified is not valid in ExecuteScalar

The specified conversion error is not valid in the code: if (command.ExecuteScalar() == DBNull.Value) { resultados[j2][i2] = 0; } else { resultados[j2][i2] = (double)(decimal)command.ExecuteScalar(); /* <<---- */ } The query...
asked by 26.01.2016 / 20:40
1
answer

C # Windows FOrms Web Services

I would like to know if it is possible to work with web services using the application made in windows forms. It's possible ? If so, would you have any references that could help me solve this?     
asked by 27.01.2016 / 17:13
1
answer

Get character index based on Width

I have the following method to calculate the width of a text: public float GetWidthOfString(string str, Font font, int bitmapWidth, int bitmapHeight) { Bitmap objBitmap = default(Bitmap); Graphics objGraphics = default(Graphics...
asked by 17.11.2015 / 14:38
1
answer

Google returning 403 Forbidden

My webservice makes a request to maps.google.com but returns exception System.Net.WebException with 403 Forbidden message But the URL usually runs via browser. What can it be? [WebMethod] public string teste() { string url = @"http://ma...
asked by 13.04.2015 / 22:49
1
answer

First letter of underlined menu for shortcut - WPF

I'm trying to put a shortcut on my system menu in WPF. In Windows form, just change the text property by placing the "&" before, but in WPF does not use "text" but "content" Does anyone help me? <Menu HorizontalAlignment="Left" Heigh...
asked by 15.04.2015 / 20:24
1
answer

How to map a read-only property in Fluent nhibernate, error in identifying setter

I have a property that should be read-only, I performed mapping via code and assign the parameter to read-only, however, it gives me an exception stating that the property setter was not found Exit: "Could not find a setter for property 'I...
asked by 20.04.2015 / 22:04
1
answer

How do I get a part of an image?

Based on this image as would be the code to separate into, as if it were sub image without dividing this image into different files: Ex: void splitImage(int numeroDeDivisoes, ref Image original, out Image[] final){ // aqui seria que ne...
asked by 20.04.2015 / 14:26
1
answer

Error Connecting to Bluetooth Printer Windows Phone 8.1 Silverlight

When trying to connect to the Bluetooth Printer gives the following error. "No more data is available (Exception from HRESULT: 0x80070103)". This error only occurred from Visual Studio 2013, in Visual Studio 2012 It worked normal. My Code....
asked by 12.05.2015 / 14:02