.net

Formatting Issues with Excel Interop using C#

I have a C# application that uses an existing Excel spreadsheet as a template and fills in data. In the template there is a blank row that has some style formatting such as font/border and data formatting such as currency and percentages. When filling in the data from the application I copy this row n times and fill in the data. The s...

C# using Excel Interop Updating Formulas

I have a C# application that builds Excel files from an existing template. On the template I want to have my row totals/averages in place and to update to however many rows are inserted by the application (Between the header and footer rows). This should be simple but I am drawing a blank in trying to remember how to do such a thing. ...

Editbox portion of ComboBox gets selected automatically

Hello, I have a small problem that has been annoying me for some hours. In my WinForms (.NET 3.5) application I create some ComboBoxes (DropDownStyle = DropDown) in a TableLayoutPanel at runtime and fill it with strings. The ComboBoxes are configured to resize automatically (Anchor = Left | Right). The problem is that whenever the Com...

NET CF Localization with Orientation Aware

Has anyone successfully localized a Mobile app that uses Orientation Aware controls to support multiple resolutions. The CultureInfo needs to be settable at runtime and not read from the system. Not sure if this is supported. Please help. Plamen ...

Can checkboxes be removed from a .NET WinForms ListView at runtime?

Is it possible to remove the checkboxes from a .NET WinForms ListView control at runtime? The following code appears to have no effect when '.Checkboxes' has initially been set to 'true' and the control has rendered onto a form with checkboxes available for each list view item: // C#: testListView.BeginUpdate(); testListView.Checkbox...

In .Net, how do you convert an ArrayList to a strongly typed generic list without using a foreach?

See the code sample below. I need the ArrayList to be a generic List. ArrayList arrayList = GetArrayListOfInts(); List<int> intList = new List<int>(); //Can this be foreach be condensed into one line? foreach (int number in arrayList) { intList.Add(number); } return intList; ...

Select from a DB2 table and insert to a SQL table

I feel like this might be a crazy question, and if anyone has a better idea of how to do it, by all means please let me know. I have a .Net C# project at work that validates certain tables against the company standards they must adhere to. The tables can be on SQL Server or DB2. When a table is initially added to the program, I gathe...

Can you have different item-text and item-values when using ObjectDataProvider?

When setting the source of an items control (ComboBox, for example), is it possible to have the SelectedValue property be different than the text that is displayed. I have a ComboBox that I want to display only the time portion of a DateTime, and have the value of each item be the DateTime object itself. Thanks! ...

My windows form is saving null value for RadioButton in SQL database.

I built a Parts Request form, and part of the form is the Approval process. This form sends an email message to the Requester indicating the decision. on My Supervisor form there are two radio buttons, one for approved and one for rejected. Now my problem is, when reviewing the requests in the application, the decision is not always ...

Formatting element/attribute values with XML Serialization

I have a class that represents credit card details. To represent valid from and expiration months and years I am using four properties of type int: public int ValidFromMonth { get; set; } public int ValidFromYear { get; set; } public int ExpiresEndMonth { get; set; } public int ExpiresEndYear { get; set; } I am XML Serializing this c...

College Software Development: Getting Data out of Datatel/Colleague

I work for a community college in North Carolina. Our most central repository of data is a software system called Datatel, aka Colleague (why it has two names, I don't know). In our case the underlying data store is IBM Unidata. I develop with .net technologies. Does anyone have any idea about consuming data from Datatel/Colleague in a...

Use custom Soap Header using Axis 1.4

I'm trying to consume a .Net 2.0 web service using Axis. I generated the web services client using the Eclipse WST Plugin and it seens ok so far. Here the expected soap header: <soap:Header> <Authentication xmlns="http://mc1.com.br/"&gt; <User>string</User> <Password>string</Password> </Authentication> </soap:Header> I didn'...

What is the overhead associated with .NET stored procedures executing on Sql Server?

Certainly there is some type of context switching, marshaling, serializing, etc that takes place when you choose to write a stored procedure in NET vs T/SQL. Are there any hard facts about this overhead as it relates to making a decision about using .NET vs T/SQL for stored procedures? What factors do you use in order to make the decis...

How do you pass parameters by ref when calling a static method using reflection?

I'm calling a static method on an object using reflection: MyType.GetMethod("MyMethod", BindingFlags.Static).Invoke(null, new object[] { Parameter1, Parameter2 }); How do you pass parameters by ref, rather that by value? I assume they would be by value by default. The first parameter ("Parameter1" in the array) should be by ref, but...

Capture standard output and still display it in the console window

I'm spawning a child process that runs in a visible console window (it's a batch file that runs MSBuild), and I'd like to have the output generated by the process displayed in the visible console window, as well as capture that output so I can process it in code. I've read several other questions and the MSDN documentation dealing with P...

Can I lazy load scalar properties with the ADO.Net Entity Framework?

I've got a database table Image with one huge column: Data. I'd rather lazy load that one column so I'm not querying all that when I get a list of all my images. I know I can put the data into its own column and entity like this: But, do I have to? ...

Visual Basic add event in .NET 1.1

I don't have a lighting bolt at the top like I normally do to add events. How do I add events in .NET 1.1 for Visual basic 2002? ...

ClickOnce download fails unless end user has VS2008

I'm still working on the problem described here, trying to get ClickOnce to work from Visual Studio 2008. I originally assumed the problem was related to the fact that the application I was deploying was upgraded from 2005. But that's not the case. I created a new VS2008 application and deployed it with the same result. I've tried (I th...

DataBindings.Add using IFormatProvider

I am trying to use an IFormatProvider to customize some databindings; however the IFormatProvider class is never being called. I put breakpoints at the begining of both functions in my custom formating class and neither are being hit through databinding. When I use my custom formating class with String.Format it works. I am using .Net ...

Are JPG, DOC, PDF, etc, files also compiled into an assembly?

Q1: Does aspnet_compiler.exe compile into assembly(ies) all files contained inside the website directory, even JPG, DOC, and PDF types? If you add images to the list of files (thus add them to the project file) in your web project, will these images also get compiled by VS into assembly? Q2: When aspnet_compiler.exe compiles applica...