I have a very simple web part. I have a single grid view, which I am populating using linq to entities (or at least that's what I want to do). The Entity Data Model .edmx file is located in the same project as the web part, and everything looks to be in working order. When I debug the project, it blows up on the entity model construct...
Suppose I have a Dictionary<String,String>, and I want to produce a string representation of it. The "stone tools" way of doing it would be:
private static string DictionaryToString(Dictionary<String,String> hash)
{
var list = new List<String> ();
foreach (var kvp in hash)
{
list.Add(kvp.Key + ":" + kvp.Value);
...
Hi,
I have the following expression
public static Expression<Func<T, bool>> JoinByDateCheck<T>(T entity, DateTime dateToCheck) where T : IDateInterval
{
return (entityToJoin) =>
entityToJoin.FromDate.Date <= dateToCheck.Date && (entityToJoin.ToDate == null || entityToJoin.ToDate.Value.Date >= dateToCheck.Date);
}
IDateInt...
This code does not disable my element as expected
if(Multifile.n==0){
$("#btnUpload").attr("disabled","disabled");
}
This code does not enable my element as expected
$("#btnUpload").attr("disabled","");
I added these lines in jQuery.MultiFile.js after what I believe is the location where files are added and removed from the Mu...
With Microsoft Visual Studio 2008, is there any native .NET functionality which allows for user customization of a Tool Bar? I.e., after the application is running, allowing the user to right click on the toolbar and select some form of a 'Customize' command. Allowing the user to hide/show and rearrange buttons and save the user settings...
I'm using ADO.Net's ExecuteNonQuery to call a stored procedure, works like a charm stand-alone but when implementing it where it should be called I'm running into problems concerning transactions.
For example
System.Data.SqlClient.SqlException: Transaction count after EXECUTE indicates a
mismatching number of BEGIN and COMMIT statemen...
How can I prevent a ToolStripDropDownButton from being closed until a item or the arrow that opens the menu is clicked?
A standart .net Winforms ToolStripDropDownButton holds its menu just as long open as you hover the menu with the mouse...
I thought of catching it in the closing event and then say e.Cancel = false but unfortunately i...
How can I detect Windows 7 (versions) in .net?
What code can I use?
...
I'm trying to use ConfigurationManager.AppSettings.GetValues() to retrieve multiple configuration values for a single key, but I'm always receiving an array of only the last value. My appsettings.config looks like
<add key="mykey" value="A"/>
<add key="mykey" value="B"/>
<add key="mykey" value="C"/>
and I'm trying to access with
Conf...
I have a complex program in which I have to first create, then use wrappers around bitmaps and send them across a lot of different classes. The problem in the end is deciding which classes should dispose the bitmaps. Most of the time the end classes don't know if they can indeed dispose the bitmap as the same bitmap can be used in severa...
Normally when you click in any whitespace in a LinqToSql dbml file, you can then go over to the properties window and set the Connection to (None). This is essential to me because it allows me to put the connection string in the web.config.
The "(none)" option does not always show for me, especially after i make updates to the generated...
This is what my .csproj AfterBuild looks like:
<Target Name="AfterBuild" Condition=" '$(Configuration)' == 'Release'">
<Exec Command=""..\Tools\ILMerge\ILMerge.exe" /internalize /ndebug /out:@(MainAssembly) /targetplatform:v4,C:\Windows\Microsoft.NET\Framework\v4.0.30319 "@(IntermediateAssembly)" @(ReferenceCop...
double d = toDateTime.SelectedDateTime.Subtract(
servicefromDateTime.SelectedDateTime).TotalHours;
string s = String.Format("{0:0}",d);
But the String.Format rounds up the value: if d is 22.91 the String.Format gives the rounding result of 23. I don't want to round up. For example, if d is 22.1222222, then...
I have a large raw data file (up to 1GB) which contains raw samples from a USB data logger.
I need to store extra information relating to the file (sample rate, description, trigger point, last seek position etc) and was looking into adding this as a some sort of header.
The header file should ideally be human readable and flexible so...
I'm writing a program in .NET that will need to utilize the statistical and data analysis functions of R or MATLAB. I have used R but am now contemplating moving to MATLAB since it has a .Net compiler while R can only interface via COM objects. Can anyone recommend going either way? I know MATLAB is infinitely more expensive than R (sinc...
I have an application which I am developing using WPF\Prism\MVVM. All is going well and I have some pleasing MVVM implementations. However, in some of my views I would like to be able to bind application settings e.g. when a user reloads an application, the checkbox for auto-scrolling a grid should be checked in the state it was last tim...
I need to capture how long it takes for my application to execute a stored procedure. The results of the procedure are being stored in a dataset by a DataAdapter. My question is does DataAdapter.Fill execute the stored procedure? If so I know I'm measuring the correct "start" point for the time interval I'm measuring.
...
Hi,
I am trying to format the date time (yyyy/MM/dd) in a repeater which is binded to an ObjectDataSource as shown
(THIS WORKS)
<%# ((MyType)Container.DataItem).CreateDateTime.ToString("yyyy/MM/dd")%>
(THIS DOES`NT WORKS)
<%# String.Format("{0:yyyy/MM/dd}",((MyType)Contai...
Hi All
In the few years I've been using C# (WINFORMS), I've never used WPF. But now I love WPF, but I don't know how the hell I am supposed to exit my application when the user clicks on the Exit menu item from the File menu. Can somone please help me out!?
I DID google this, and guess what? For such a Simple? thing... Nothing related ...
Hi,
I have a custom control that has an event.
I have a window using that custom control.
The window is bound to a viewmodel.
I would like to have the event from the custom control direct to an ICommand on my viewmodel.
I am obviously being dense here as I can't figure out how to do this. Any assistance is most welcome.
Thanks
...