.net

Update requires a valid UpdateCommand when passed DataRow collection with modified rows.

So I had this working last week. At least, I thought I did! http://stackoverflow.com/questions/548091/datagridview-update Then I start working on the project again today and am getting "Update requires a valid UpdateCommand when passed DataRow collection with modified rows." On scDB.SSIS_Configurations_StagingDataTable table = (sc...

SqlConnection.RetrieveStatistics() doesn't populate the collection ( I do have StatisticsEnabled set to true )

hi I started learning learning Ado.net and got a bit stuck. 1) If I enable connection statistics via SqlConnection.StatisticsEnabled property, then I should be able to retrieve various information ( via RetrieveStatistics() ) about actions SqlConnection instance performs. Thus, before calling the code below, I already opened a conne...

How do I set the name of the print job when using DocumentViewer control?

I've using the WPF DocumentViewer control to display an XPS Document like so: viewer.Document = xpsDocument.GetFixedDocumentSequence(); When the print button inside the document viewer is clicked everything prints okay, however the name of the print job is System.Windows.Documents.FixedDocumentSequence, which is less than ideal. How ...

C# memory address and variable

in C#, is there a way to Get the memory address stored in a reference type variable? Get the memory address of a variable? EDIT: int i; int* pi = &i; How do you print out the hex value of pi? ...

Best Practice for Creating a .net dll vs vb6 dll for VB6 desktop app?

Hi guys, I'm trying to create another dll with just forms and some shell method to call an external exe while allowing my main form to run unpertubed sort of something like a pseudo multithreading. And all of these wholesome goodness are in old vb6 legacy app. So i'm trying to decide if i should use .net to write the dll or vb6 to write...

Avoid firing OnWorkflowItem changed for changes made by the workflow

I have a state machine workflow that responds to changes in a list item. The workflow also updates the list item; is there any way to avoid firing the OnWorkflowItem changed event when the changes were made by the workflow? ...

How to get the data source information from a SSRS report, using .NET

I am currently making an ASP.Net and C# page, which is a front end for some reports. I also want to run some queries, from the same data source as the reports (each report uses just 1 data source). Is it possible to extract the data source connection information from a report, using either ReportingService2005 or ReportExecutionServi...

Using the All operator

I would like to see an example that makes the best use of the ALL operator when using a parent child reltaionship in LINQ. Can you show me one please? ...

project does not contain a configuration called 'Debug|x64'

Hi, I'm trying to build a C++ project with a build configuration platform of x64. It's on a new machine running a 64 bit Windows Server 2008. When I open the build configuration manager in VS, I can't chose or create the x64 platform and the project gets skipped. When I try to build it with MSBuild I get the error: VCBLD0004: Project 'M...

In what languages/platforms is Invoke for GUI operations required?

I understand that in .NET, one needs to use Control.Invoke(delegate) to perform operations on a control. This lead me to wondering in which environments Invoke is actually required. As far as i know, it was not required in older versions of, say, Visual Basic and Pascal. In particular, what is the status of Java (possibly version-depende...

Replacing foreach with LINQ query

I have the following code in one of my methods: foreach (var s in vars) { foreach (var type in statusList) { if (type.Id == s) { Add(new NameValuePair(type.Id, type.Text)); break; } } } This seems sort of ineffective to me, and I was wondering if there was a way to substitute...

In WPF, what are the differences between the x:Name and Name attributes?

The title says it all. Sometimes it seems that the Name and x:Name attributes are interchangeable. So, what are the definitive differences between them, and when is it preferable to use one over the other? Are there any performance or memory implications to using them the wrong way? EDIT Responses so far suggest that using x:Name al...

What options are available for the layout of directed or undirected graphs in .NET?

By graph here I mean something resembling these images: The ideal solution would: use only managed code allow output to a bitmap image allow output to WPF elements include some kind of interactive surface for displaying the graph that supports zooming, panning and reorganisation of nodes I'm also interested in hearing about proj...

How to move from Linq 2 SQL to Linq 2 Entities?

I'd like to start a reference for people who want to move from linq2sql to linq2entities and the ADO.net Entity Framework (in here called L2E). I don't want to discuss which of these two is better. I just want to create a list of differences between these two for people who want to transition from one to the other. The basic stuff is ea...

Is it possible to use query parameters to fill the IN keyword

Imagine a table with GUIDs as primary key. I would like to select a few of these rows based on their primary key. I would like to use a query like: SELECT * FROM mytable WHERE id IN ('firstguidhere','secondguidhere'); I am using ADO.NET to query the database, so I would like to use a parametrized query instead of dynamic sql, which wo...

Html.DropDownList in ASP.NET MVC RC (refresh) not pre-selecting item

In my controller, I have the following: ViewData["myList"] = new SelectList(itemRepository.GetAll(), "Id", "Name", currentItem.Id); And in the view I have: <%= Html.DropDownList("myItem", (SelectList)ViewData["myList"])%> The rendered drop down list should have the item with the Id of currentItem.Id pre-selected but it doesn't....

.NET Make xml more readable

Is there any way to take an xml string in .net and make it easyer to read? what i mean is can i convert this: <element1><element2>some data</element2></element1> to this: <element1> <element2> some data </element2> </element1> is there any built in class for this? as sql server 2005 seems to remove all formatting on...

How can you name the Dataset's Tables you return in a stored proc ?

I've got the following stored procedure Create procedure psfoo () AS select * from tbA select * from tbB I'm then accessing the data this way : Sql Command mySqlCommand = new SqlCommand("psfoo" , DbConnection) DataSet ds = new DataSet(); mySqlCommand.CommandType = CommandType.StoredProcedure; SqlDataAdapter mySqlD...

DebuggerDisplay Attribute does not work

This is a C++/CLI WinForms project targeting the .NET 2.0 framework. I am using Visual Studio 2008. How do I get it to work? EDIT: Code snippet [Serializable] [DebuggerDisplayAttribute(L"ID={EmployeeID}")] public ref class Employee { [ReadOnly(true)] int nID; property int EmployeeID { int get() { ...

Stack overflow when setting MasterPage properties

I'm getting a stack overflow when tryin to set a public property in a MasterPage from an ASPX page. I'm making a "greeting card" editor, using a TabContainer. Each tab has a user control, and everything is updated when active tab is changed - while doing so I need to store all the data away in master page properties. From the ASPX pag...