foreach (PropertyInfo PropertyItem in this.GetType().GetProperties())
{
PropertyItem.SetValue(this, objDataTable.Rows[0][PropertyItem.Name.ToString()], null);
}
In one of the loops i get this exceptional error:
Object of type 'System.DBNull' cannot be converted to type 'System.String'.
The error occurs because one...
is there a way i can have markdown in .NET/C# application?
i wonder shld i store the data in HTML or markdown text? if i store the data in HTML, when the user edits, they will see HTML, but if i store in Markdown, everytime i display, i got to convert to HTML(slow?) or store the HTML in another column, will it waste too much space?
i ...
I am an experienced asp.net web forms developer using c# but i have never used asp.net MVC. As I am just starting out with mvc i would like to start with mvc 2.
I am looking for a good intro/tutorial to help me understand the basics. I am aware of the Nerd Dinner but that is based around MVC 1.
What would you guys recomend for me to...
Code:
printfn "%10s" "abc"
printfn "%-10s" "abc"
printfn "%10d" 123
printfn "%-10d" 123
printfn "%10c" 'a'
printfn "%-10c" 'a'
Output:
abc
abc
123
123
a
a
So right aligning %c does not work as I expect...
F# 2.0 build 4.0.30319.1
...
I was searching online for a solution to passing a string array to a stored procedure in Oracle. The "easy" but messy way was using a comma delimited string.
I had found a sample based on which I created my own type of TABLE of VARCHAR2(200).
I understood that I could use a constructor created "behind-the-scenes" by Oracle to give a li...
Hello,
How do I compress/decompress a string in VB.NET ?
I am trying to send long string through the Network and need them to be as small as possible before sending.
Thanks
...
I'm working on a custom ComboBox for a project, and have the basic painting working.
One of the remaining things to do is make it look like the default ComboBox in Vista and 7, when the DropDownStyle is set to DropDownList (looks like a button instead of a regular ComboBox).
I read much about VisualStyleRenderer, read ComboBox.cs and Co...
Hi
I'm trying to get my .Net Windows Service to right to a custom event log. I'm using EventLogInstaller to create the event log and source when the application is installed. I read here that it takes a while for Windows to register the source so they reccomend you restart the application before trying to write to the log.
As this is ...
I have been reading about protobuf-net and it is amazing!
Are there any tutorials that I could use? (More specifically for Dictionary<TKey,TValue> and contracts for generics)
Are there any tips associated with it?
Could I simply plug it into my current codebase or are there any changes I need to do?
...
After googling for a while I'm still drawing a blank here. I'm trying to use a ViewModel to pull and provide a dictionary to a drop down list inside a strongly typed View:
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="EveNotebook.ViewModels.CorporationJoinViewModel" %>
...
<%: Html.DropDownLis...
When I turn on Code Coverage in my test settings, on a project that references the Unity DI container I get the following error:
Cannot initialize the ASP.NET project
'{Project Name}'.
The event log specifies the following reason:
Could not load file or assembly
'Microsoft.Practices.Unity,
Version=2.0.414.0, Culture=neutr...
Problem: If I pass a class with value semantics (Equals method overridden) to NHibernate, NHibernate tries to save it to db even though it just saved an entity equal by value (but not by reference) to the database. What am I doing wrong?
Here is a simplified example model for my problem:
Let's say I have a Person entity and a City enti...
I'm a developer for just about 6 months now, and since I enjoy programming I've started little programs such as encripters, calculators, tools, stuff to play with DropBox (hehe), stuff that play with bitmaps, drawing graphics, and even a program to update the MSN display image according to the artwork of the music you're listening yo on...
Hi Guys,
I've spent far too much time with this and can't find the mistake. Maybe I'm missing something very obvious or I may have just found a bug in the WPF Element Host for Winforms.
I am binding a ListView to a ObeservableList that lives on my ProductListViewModel.
I'm trying to implement searching for the ListView with the gen...
I'm learning WPF with MVVM and for a starter, I viewed Jason Dolinger's video on MVVM . In that he mentioned, that one of the advantage of using MVVM with WPF is two-way data binding. My question is what does he mean by two-way data binding? Is that the feature of ability to 1) bind data from controls(View) to properties in VM and 2) any...
I am looking to see if there is a good library or framework that I can use to simplify adding user/group/permission management to a .Net application (4.0 VS2010). If the framework can work on it's own or integrate with Active Directory that would be a huge bonus.
So far I have found Visual Guard, if you have any experience using Visual...
Hello,
I have a number of custom objects of type X. X has a number of parameters and must be unique in the collection. (I created my own equals method based on the custom parameters to examine this)
In each object of type x, I have a list of objects y.
I want to add/remove/modify easily an object y.
For example:
To write the add meth...
Well I have been able to figure this out but what I want to do is make my string have a new line after 20 chars. I know how to find how many chars the string has but not how to insert environment.newline at 20 chars.
I am using this to find the string length
If string.Length > 20 then
'Need to be able to insert environment.newline at 2...
Hi,
I'd like to make a textbox that accepts only numbers, but not integer, but rather double.
I've read here about e.Handled = Not Char.IsDigit(e.KeyChar) and it works, but again, it can be used only for integer, since it declines decimal point.
Another thing I've read here is If Not Double.TryParse(TextBox2.Text, value) Then .... and i...
Hi All,
Okay, Only a couple weeks ago I had an old 32bit computer, but had to buy a new computer, which happens to be 64bit.
I've rewritten the method that sends e-mails asynchonously and it just does not work. And does NOT throw any exceptions either.
What gives?
I have also tried the Async method code found iin MSDN, and the BlackW...