I am working with a DataGridView filled up from a view in my database.
Being a view (maybe I'm wrong) I can't use the TableAdapter.Update() method so I need to know the altered cells from the DataGridView so I can update the values in their respective tables programatically.
Can you help me?
...
Years ago I had seen a tool that when running would allow you to click on a running Winforms application and it would reflect on whatever portion you clicked on to display properties etc of the code. (It saved some time as you could find the exact form/panel/tab etc. that a control lived in)
eg. I have a Winforms app with tabs, panels, ...
I have an .net app that seems to have a memory leak issue(s). The .net service starts out around 100MB of memory, but under load it hits around 400-500MB. Most of my classes don't have unmanaged resources, and the ones that do already implement IDisposable. So my question is would slapping IDisposable on my classes help?
The 4-500 MB is...
I'm looking for some code in .net to allow me to test an xml file to determine if it is well-formed. I am not validating the file against a schema at this point in my code, just testing that it conforms to xml specification for being well formed.
Any assistance is appreciated.
...
I want to create a project that contains 2 views and 2 viewmodels.
One of the views will display persons that i get from a feed and the other will display the weather which I also receive from a feed.
Now in my viewmodellocator constructor I have
static ViewModelLocator()
{
Container = new UnityContainer();
...
I'm working on a simple vector drawing app in C#/.Net. The drawing is done in a panel, but I'm not using the OnPaint() event for all of it - in fact the OnPaint() even just calls another method which actually draws everything in the document.
I tried to add double buffering, but when I set DoubleBuffered to true, the flicker issue is ev...
I created a customized ListView class, BinableListView, which inherits from ListView. I was able to drag and drop the custom ListView into a Form in the designer window. Now, I am trying to add the custom ListView in another User Control first, and add that User Control into the form. However, VS displayed TypeLoadException when I drag a...
In VS 2008, when I compile, I get a large series of The class or CssClass value is not defined messages.
How do I get the error/warning code (something like "C0167") for that message, so I can disable it?
Answers that won't work:
The compiler gives you the warning number. No, it doesn't.
See the list of MSDN compiler errors (found a...
I am working on a project at the moment which is using WCF for all communication.
Standard sort of coding, using ChannelFactory and CreateChannel to access methods and objects running on the server.
Now, I have a form of event system setup, where a db table stores all the endpoints to inform given certain condiitons.
So something happen...
Is there any way (in C#) to display a form with just the minimise and maximise buttons? Without the close button?
The only way of removing the close button (that I'm aware of) is:
form.ControlBox = false;
But this also gets rid of both the other buttons.
...
Here's my hypothetical example. I have a very simple WPF window with a one Button. The Button.Click event has a handler that goes like this.
Action doit = () =>
{
Action error = () => { throw new InvalidOperationException("test"); };
try {
this.Dispatcher.Invoke(error, DispatcherPriority.Normal);
} catch (Exception ...
(I know there's some close duplicates out there, but none of them were able to help me, please hear me out)
I have the setters of my model throwing appropriate exceptions when something attempts to set an invalid value. This works wonders for validation when the user types a new value.
However, when I create a new model object, the ini...
So, In my old Linq-To-SQL I would write code like this
var tableItem = new Table
{
Prop1 = var1
Prop2 = var2,
Prop3 = var3,
ParentTableID = parentRecordID
};
db.Table.InsertOnSubmit(tableItem);
db.SubmitChanges();
After converting my working code from Linq-To-SQL to Entity Framework (v3.5) the ParentTableID property i...
Say I have a list of Person objects:
class person
{
int id;
string FirstName;
string LastName;
}
How would I sort this list by the LastName member?
List<Person> myPeople = GetMyPeople();
myPeople.Sort(/* what goes here? */);
...
I have a need for allowing business rules to be defined in a commercial, shipping product with respect to data authorization rules. The rules need to be customizable in the field, and the customizations need to survive updates of the application. The system is C#/ASP.NET.
I've considered using a DSL for this, but it seemed like a lot ...
We are using Moq as our mocking framework, the problem is that type that needs to be mock-able is done using an interface, the problem with that is anything in that interface will be public and therefore considered part our public API.
is there a way to have to have a member that is mockable and not public?
...
Hi I found problem with EF.
Here is my Model
I loaded asset:
POCO.Asset asset = _context.Assets.Where(a => a.UID == assetUid).First();
then I go through all properties
foreach (POCO.Property p in asset.Properties) /* request to db */ { /*...*/ }
categories:
foreach (POCO.Category p in > asset.Categories) /* request to db */ { /*...
Does anyone have a regex that checks if a string is a valid AD account name?
e.g. accounts can't have "@" and so forth.
...
Hello,
I am learning the ropes of Microsoft Sync Framework, and have a question.
For the sake of simplicity, let's say I have a table called [Project] in SQL Server with the following structure:
[Project].[ProjectId] (PK, UID)
[Project].[Name] (varchar)
[Project].[Leader] (varchar)
I create an Scope called 'filtered_proj...
While searching on how to escape a single quote in String.Format, I found the answer at SO: Escaping single quote in String.Format()
It seems to be different for VB though. I tested it, and indeed C# needs
string s = DateTime.Now.ToString("MMM d \\'yy 'at' H:mmm");
while VB needs
Dim s As String = Now.ToString("MMM d \'yy 'at' H:mmm...