C# is a multi-paradigm programming language encompassing strong typing, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines.

learn more… | top users | synonyms (4) | c# jobs

0
votes
0answers
6 views

Excel interop workbook.SaveAs() removes original formatting?

How can I preserve a worksheet's formatting when using Microsoft.Office.Interop.Excel.Workbook.SaveAs(...)? For example, I start by opening an existing worksheet that has formatting. I then use the ...
0
votes
1answer
16 views

Retrieve the [StructLayout] attribute of a struct

I would like to fetch the struct size of 22 bytes from the StructLayout applied to the following structure. [StructLayout(LayoutKind.Explicit, CharSet = CharSet.Ansi, Pack = 1, Size = 22)] internal ...
0
votes
1answer
15 views

Get current sound volume windows 8

The result of the sound level is always 0, wether i have the sound muted or at max volume. What is wrong ? [DllImport("winmm.dll")] private static extern int waveOutGetVolume(IntPtr hwo, out uint ...
-1
votes
1answer
25 views

How to use javascript variables vales in code behind(in c#)

Hi i have facebook login code i want to use javascript varibles values on code behind.I can use by saving them in hidden field but there is no button click so page is not postback. here is my code: ...
0
votes
0answers
17 views

.Net Restful POST with Actionscript

I am trying to create a method in actionscript to call a Restful service in .Net. The method is: public function executeService(serviceName:String):void { var request:URLRequest = new ...
0
votes
1answer
16 views

how to bind a grid with an object

I am an amateur to windows phone development and also new to wpf. I have a grid : <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0" > <Grid ...
0
votes
2answers
39 views

ConnectionString Database c#

I am create a database utility and I seem to not be able to get my connectionstring correct. SqlConnection conn = new SqlConnection(); conn.ConnectionString = "Data ...
4
votes
3answers
35 views

Generic parameter isn't choosing the most specific signature?

When I use a method with a generic parameter to create another object, the generic object isn't selecting the most specific constructor. That sounds confusing, so here's some sample code to ...
0
votes
1answer
24 views

Excel parsing C# without interop

What is best way and practics parsing excel files without using COM interop or OLEDB connection
0
votes
2answers
14 views

My partial view is not passing the values to the model correctly

I have a huge problem that I'm extremely confused on. I'll give you a little background first. I have two models, one that contains the other like public class AccountViewModel { public ...
2
votes
1answer
45 views

Regex to C# regex

I found a regular expressions that would find: bb:hhhh="blajkeh32;,,;sekj;f!!!;" that would also find: bb:hhhh="blfsefsefsajkehsdfsdfse32;,,efsefesekj;f!!!;" where: bb:hhhh="" is constant. I ...
3
votes
3answers
22 views

How to Left Outer Join two DataTables in c#?

How can I Left Outer Join (I think it is Left Outer Join but I am not 100% sure) two data tables with the following tables and conditions? dtblA: col1 col2 1 Hi 2 Bye 3 Later ...
2
votes
0answers
15 views

Call Expression within a constructorless instantiation of an object within the select of a LINQ to Entities query

I had a hard time writing the title, but there's what I want to do : class MyDbContext : DbContext { private static Expression<Func<MyClass, int>> myExpression = x => x.MyProp; ...
1
vote
0answers
6 views

FluentSecurity makes Azure WebRole to fail

I have a ASP.NET MVC website using FluentSecurity. As a Azure Website it works just fine. I need to make it a WebRole. I added a WebRole project but the WebRole fails at startup with a generic "The ...
0
votes
0answers
10 views

Is it possible to make a screenshots of a UIElement built in code-behind and not shown?

I would like to know if it is possible to "screenshot" an element without showing it on screen. For example, this StackPanel: private void Button_Click(object sender, RoutedEventArgs e) { ...
0
votes
2answers
13 views

How to send ajax request to request XML response to asp.net MVC 4 controller?

OK so my asp.net MVC4 controller called Home is almost restful, so if I do this in Firefox or IE http://localhost:1193/Home/?serialcode=123456789123321 It gracefully shows a page with a code like ...
0
votes
0answers
3 views

SHBrowseForFolder on WinCE does not layout correctly

I'm attempting to p/invoke the SHBrowseForFolder API to prompt the user to select a folder and I am seeing the title static / label field float on top of the tree control. The code was downloaded ...
-3
votes
0answers
20 views

Windows 7 flyout window

How to achieve this built in behavior in custom win7 flyout window? When notify icon of some builtin flyout (battery meter for example) is inside NotifyOverlyWindow and flyout is shown that window ...
1
vote
3answers
30 views

C# Button Visibility Issue

I have programatically added several buttons to a C# Form, but only the ones I added via the Designer actually show up. The rest stay invisible even though. I am performing a lot of operations before ...
2
votes
0answers
8 views

Invalid Response Error when Retrieving Google Analytics Data with a Service Account in C# .NET

I'm trying to write an online application to access my google analytics data using a google service account. Here's my code: using System; using System.Collections.Generic; using System.Linq; using ...
-3
votes
0answers
11 views

Restrict child element within the boundaries parent

I am using RenderTransform to move a rectangle using key down events in metro c#. The control is going out of screen when it is been moved. How to restrict the rectangle to stay inside a grid?
0
votes
0answers
4 views

Adding a custom “page” to the Windows 7 control panel. No new application window

Hello StackOverflow Community, I hope I am able to describe my problem so that it is possible to answer it! In abstract: I want to expand the windows 7 control panel. I know that you can add an link ...
1
vote
0answers
12 views

Refreshing Image Control To Display File Upload Preview

Hi i'm trying to display a preview of an uploaded img in asp.net using the file upload control, i have a preview button where when the user clicks should save the file from the fileupload control into ...
0
votes
0answers
14 views

How to kill child process that run exe file to do'nt close the form call that file

I have a Form is MainForm, mainform have button to call Editor.exe here is code call exe file: private void InsertEquaButtonClick(object sender, EventArgs e) { Process p = ...
1
vote
2answers
27 views

How to Display Assembly Information as an “about” page in C# using visual studio?

I am new to using Visual Studio. I like how the assembly information displays all of the build and revision information in the properties page of the app. Is there a way i can create a button that ...
0
votes
0answers
12 views

XNA BoundingBox & Origin

I have seen a few answers on this subject but none have really been much help. Quite simply, BoundingBox collision. With a origin set at 0,0 the collision occurs fine (at least for how I want it). As ...
5
votes
3answers
87 views

Type safe way to return values from a scripting language in C#

I have been working on a small mathematical scripting engine (or DSL, if you prefer). Making it for fun, its nothing serious. In any case, one of the features I want is the ability to get results from ...
-4
votes
0answers
26 views

How can i create an accelerometer for animation?

I have a simple storyboard with a double animation which has a easing function. How can I create an accelerometer to printing current acceleration value of this animation?(real-time) Thanks a lot
0
votes
0answers
22 views

C# graphics.drawImage() crops my Image

I am trying to put an image on a bigger image. But the inner image was cropped after drawImage(). Here is my code: Bitmap im = new Bitmap("D:\\Steffen\\New folder\\I1\\I1\\" + filename + ".png"); int ...
0
votes
4answers
39 views

Replacing illegal or undesired characters in requested URL before processing it .net

My site throws an exception every time a special kind of character is included in the request, or when the size of the URL exceeds a certain length. How can I control the URL and transform it before ...
0
votes
0answers
14 views

Drag and Drop DataGrid

How do you make a DataGrid in C# ASP.net so that you can drag and drop the rows to reorder them. I want to use the actual DataGrid tool from the toolbox not a lookalike.
0
votes
0answers
5 views

Building a contact form in Umbraco 6

I'm trying to build a contact form in umbraco v6 by following the following this tutorial. The problems I'm having are that a) The form seems to be posting on load ie. I'm presented with required ...
0
votes
3answers
22 views

Charts for ASP.NET MVC 4

I searched on the documentation and I did not seem to find much info regarding this subject. ( I saw some for Web Forms, but I am using MVC ). What I want to accomplish is to get some data from the ...
1
vote
2answers
26 views

How to get this captcha image link?

I need to show this captcha image ( http://www3.dataprev.gov.br/cws/contexto/hiscre/index.html ) in a C# application, but I can't get it to work! I have no ideia how to get the captcha link, this link ...
0
votes
0answers
4 views

Saving the CurrentPageIndex of Radgrids

so I'm currently using RadGrid to display the results of a link query. Each of these results has a bound item command that allows the user to go in and Edit or Delete that record. The problem arises ...
0
votes
2answers
60 views

When to make a custom type a property vs a member

Let's say I've got a Car class and that class contains a Radio object. Which looks like class Radio { public string Model { get; set; } private List<string> myChannels = ...
0
votes
0answers
4 views

JwtSecurityTokenHandler().ValidateToken() :: Signature validation failed… sha256 not supported in this context

I am getting the following error when I execute the JwtSecurityTokenHandler().ValidateToken() function: Here is my pseudo-code: var jwtToken = {...} var tokenHandler = new JwtSecurityTokenHandler(); ...
1
vote
1answer
26 views

System.Net.HttpWebRequest works infinitely

I have such function : static void doAction(string link){ Uri myUri = new Uri(link); HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(ur) ; request.GetResponse(); } After ...
1
vote
4answers
27 views

C# Actively detect Lock keys

I have a wireless keyboard and mouse that doesn't have any lock indicators, nor any software bundled to provide a visual aid, so I'm making my own. I got it so that if I click on a notifyIcon it'll ...
0
votes
0answers
11 views

How do I attach a second process when the debugger starts?

I'm trying to attach to a second process when the debugger starts using the code: DTE dte = BuildaPackage.VS_DTE; EnvDTE.Process localServiceEngineProcess = dte.Debugger.LocalProcesses ...
0
votes
0answers
7 views

WPF window build dll COM VBA “Application instance in the same AppDomain”

I wrote a little COM-visible dll which can show a WPF window. I set my dll in a VBA script reference (excel -> VBA) and when I run first time everything is OK, after that the VBA sub is finished and I ...
0
votes
1answer
21 views

event of selecting a item in combobox

I have a combo box and textbox in form, (in windows form platform), the textbox visible is false by default, I want to show (visible=true) the the textbox when the specific item of combo box selected. ...
0
votes
0answers
7 views

Can't call End Conversation through the Service Broker on all entities?

I am using the Service Broker on SQL Server 2008 R2, and I am registering a query that is joining multiple tables like this: SELECT A.Date ,A.Id ,P.LastName FROM dbo.Appointment A ...
0
votes
2answers
18 views

Not able to establish connection via SqlHelper class in asp.net

string strCon = ConfigurationManager.ConnectionStrings["constr"].ConnectionString; Company.Common.SqlHelper.Connect = strCon; Getting this exception someone please help ...
1
vote
1answer
15 views

Export to Excel button from web page gives an error after the file is downloaded to the users machine: “File format or file extension is not valid”

Here's the Export button: protected void btnExportToExcel_Click(object sender, EventArgs e) { var dataTable = (DataTable) Session["finalSchedulesTable"]; var dummyGv ...
0
votes
0answers
14 views

Cron Jobs with C# asp.net

This is noobish but I am totally confused. I cannot find a good Google Article to know every small detail about Cron Jobs and using them in asp.net coding[with C#]. I am new to Web Development, that ...
0
votes
1answer
17 views

c# character shift/message decoder

I am stuck on an extra credit class assignment. It is: Write a program that decodes secret messages read from a text file using an "alphabetic shift." You must: 1.) Read the encoded message from ...
0
votes
0answers
54 views

Writing to compound SQL table with C#

I am a newbie to the C#, SQL, and ASP.NET MVC world. I have to write to the following SQL tables (can't use SQL have to use C# with MVC): Read-Write Group //Contains Groups. Consists of an ID and a ...
0
votes
1answer
29 views

How to sort json to text?

How can i sort a string from JsonText string to Sorted strings? From { "A": "Command", "B": [], "C": "leaderboard.leaderboard", "D": 3, "E": "get_leaderboard_infos" } to A : Command D : 3 E : ...
0
votes
1answer
23 views

foreach xmlnode selectsinglenode not working correctly in c#

I am trying to create a list where each item in the list contains the name of the package and the location where is it saved. I created a constructor with two variables name and location. Then I ...

1 2 3 4 5 9745