.net

Retrieving properties from a GUI object in a thread

Guys, I have a C# program that executes a thread. Inside this thread, I have the following code: string strDropDownValue = (string)ddlVersion.SelectedItem; I am trying to retrieve the selected value from the drop down list. This line works, obviously, in a single threaded application. Because I'm doing this from a thread though, I ge...

.NET Structs that can be assigned constant values directly like built-in types

Can you make a struct that behaves like one of the built-in classes where you can assign the value directly without calling a property? ex: RoundedDouble count; count = 5; Rather than using RoundedDouble count; count.Value = 5; ...

Uploading Difficulties to Discountasp.net, new at C#

I've been trying to upload a new page to a site hosted on a DiscountASPnet server, but have been having trouble. I have been working on this site in the development server for a while now. it was already built and hosted when I got my hands on it, and I haven't worked in ASP.net before. First I uploaded the page itself, the code behind, ...

WPF - How can I implement an ObservableCollection<K,T> with a key (like a Dictionary)?

I have used an ObservableCollection with WPF for binding and this works well. What I really want at the moment is a Dictionary like one, that has a key that I can use, so effectively like "ObservableCollection". Can you suggest the code that could be used to provide such an ObservableCollection? The goal is to have a Dictionary like s...

WPF Data Grid - How to hide the next column/row that is visible?

I'm using a WPF data grid to bind to an object (i.e. not a database). I have the horizontal alignment on Stretch. I currently have it within a Border, which is within a Grid. However when I run the application the DataGrid has a blank column and grid showing. That is say I have 5 columns & 5 rows, then there is a blank 6th column and...

InitialToggleState in multi groups, reportviewer

Hi Guys, I am facing a bit issue with toggling result in ReportViewer. I have a multi groups in display result table [ 1). Date 2). Business Type 3).Business Category ]. In all cases, result always display expanded. I have set correct value at IntialToggleState = false and Hidden = false inside visibility Group. In case when I ask to co...

.jar to .cs class/file transform technique or utility?

I am looking for a way to transform some classes from Java to .Net in a code gen way. Not at run time, but re-generate a handful of business objects as needed (not often). the catch is, i want to have full control of how they end up. So while java classes have get and set methods, i will create a property out of them. the only way i...

Dealing with Doubles imprecision other than using Decimals

I'm having the doubles imprecision problem with the common mathematical operations. It's the one where a simple addition would append a 00000000x to my double. I've read from another question that decimals should be used instead. But the app I'm using this for is statistics related and performance is an issue. I've read somewhere that...

WFP DataGrid ItemsSource binding to ObservableCollection doesn't update beyond first setting?

I am binding a WPF application DataGrid to an ObservableCollection via the DataGrid's "ItemSource". Initially the DataGrid does come up with headings and values, however the upgrades made to the ObservableCollection are not reflected? (i.e. when I come back programmatically and increase the "Total" value) The ObservableCollection I a...

writting data into asp.net page in xml format using C#

Hi everybody I want to show my data to a asp.net Page using c# in XML format Plz anybody send some example with code. like - <person> <email>[email protected]</email> <dob>YYYY-MM-DD- HH:MM:SS</dob> <city>XYZ</city> </email> </person> So plz send some code with a good example. Thanks in Advance ...

How do I Display Progress Spinner (or other UI) While WPF ListView is Being DataBound?

I have a WPF list view that is bound to a list of objects. One of the items to be displayed is a calculated property (read-only, returns a string) that takes a small amount of time to calculate. When the window initially loads (or anytime the UI is updated with a Notify event) the UI will hang as this data binding occurs. What I was w...

How to select number from Excel file?

I use this code to load an Excel file into a datatable: public static DataTable ImportExcelFile(string connectionString) { DbProviderFactory factory = DbProviderFactories.GetFactory("System.Data.OleDb"); var listCustomers = new DataTable(); using (DbConnection connection = fa...

Missing dependent assemblies - how to get a compiler error rather than a runtime error

Situation Assembly Adam.dll has a reference to assembly Frank.dll. Adam.dll is placed in a shared assemblies folder and is then referenced by my application as a binary reference. If I run my application it will crash (and rightly so) because Frank.dll is missing. If however, I place Frank.dll in the shared assemblies folder the .n...

Default value of Version class: null or (0,0)?

Hello, we identify client software using Version class and use these values extensively, we also store these values in database. How would you store unknown version value? We can get unknown version value if we wasn't able to successfully query client version. I ask because I'm fond of Null object pattern, I don't like constant checks...

Design Guidelines Distributed computing.

Hi there, I have a software system that performs OCR on Multiple machine simultaneously. Current system works as follows: All documents which needs to be ocred are inserted into a table in db. Each client ocr machine pools that table and whenever data is found for ocr, it locks table and pick n no. of files for ocr. Locking is used for...

C#/Silverlight: I want to pass a variable that I want to use in the async callback function

Ok I am using the HttpWebRequest BeginGetResponse and I pass in the async callback function, now I want to pass in a variable/context as well that I want to my callback function to get. How do I do this. I am fairly new to the C#/.Net/Silverlight world. HttpWebRequest absRequest = (HttpWebRequest)HttpWebRequest.Create(new Uri(urlToFetc...

How do I add an XML Map programmatically to an Excel 2010 Spreadsheet?

I have a basic XML file, which I need to add as an XML Map to an Excel 2010 Worksheet. How do I do this programmatically? I would prefer a solution which uses Microsoft OpenXML SDK. ...

gui implementation approach in c# and .NET

Hi, I am a complete begginer in C# and .NET. I am supposed to implement a GUI for a back-end process in C#. The design I am required to follow, is to have a datagrid to display the data and as users click on rows, other representations appear.E.g. a graph of the data. The gui is managed by a process, e.g. ProcessA. Another process, e.g....

provider for PostgreSQL in .net with support for TransactionScope

is there some library for connecting to postgresql database and to have support for TransactionScope I tried Npgsql but it doesn't yet support transactionscope ...

Design Issue: Good or bad to make the cached entities mutable?

Hi guys, Here I need to cache some entites, for example, a Page Tree in a content management system (CMS). The system allows developers to write plugins, in which they can access the cached page tree. Is it good or bad to make the cached page tree mutable (i.e., there are setters for the tree node objects, and/or we expose the Add, Remo...