.net

How to tell whether a file system object is a path or a directory

Possible Duplicate: .NET How to check if path is a file and not a directory? Hi, Can anyone think of a good way of telling whether a file system object path equates to a a file or a directory? I did have the following method: public static bool PathIsFile(this string fullPath) { return (Path.GetExtension(fullPath).Length ...

How do I load data to a list from a dataReader?

Hi all, I am tryin to add data to my list object. For a string, I just say, this.name = myDaraReader["test"]toTring(); How do I go about doing that for a list? ...

IE 8 only has access to session cookies?

Project I'm working on gets cookies from the browser to check for certain things. In FF, Safari, or Chrome, this works fine, but in IE 8 (don't have an earlier version of IE to test and MSFT won't let me uninstall IE 8 and have a working IE 7), the only cookies it sees are the session cookies, not any of the persistent cookies (the ones ...

Are there any open-source free replacements for a richtextbox in WPF?

I have a requirement to create an application that will open up about 10 mb log files and highlight certain expressions. I thought using WPF and richtextbox will work, but the richtextbox rending time is unacceptable. Is there anything that has richtextbox like highlighting, but has better performance? There any other way to accomplis...

Serializing a DataTable with an IPAddress column

I'm using C# with .NET 3.5. I am using the System.Configuration.ApplicationSettingsBase class to load and save application settings. One of the settings I would like to preserve is an in-memory System.Data.DataTable. The DataTable contains just two columns of type UInt32 and System.Net.IPAddress, respectively. When I call the Save() ...

Possible to insert a new row in a silverlight datagrid from the UI? or only by modifying the datasource?

In WinForms it was possible to add a new row to the grid by using the last row in the grid, some grid controls provide such functionality through the Insert button. Is this possible with the datagrid included with silverlight? My only available option is providing input controls to the user with a insert button and manually adding a ne...

LINQ to SQL replacement in .NET Compact Framework

I have been tasked with porting our .NET Desktop application to a mobile device. Our desktop application uses LINQ to SQL to interact with the database. However, LINQ to SQL is not available on mobile devices. We develop for Windows Mobile 5 and 6. I am debating between suggesting a different ORM that supports both desktop and mobile...

DotGNU vs Mono

DotGNU and Mono seem to be attacking the same problem - namely implementing the .NET CLR in a free, open-source way with an eye to cross-platform compatibility. I've been reading quite a bit about both, and I'm having a hard time deciding which implementation to use for an upcoming project. My particular project doesn't need System.Wind...

Presentation layer referencing data layer

I have a 3-tier .NET 2.0 app. The presentation layer references the middle tier. The middle tier references the database layer. For some reason, when I compile, the dll's for the data layer appear in the bin of the presentation layer. How do I stop this? ...

FTP Server with database driven content?

Our organization currently has an external customer website that allows customers to download files that are created for them. There tends to be some shifting in the security, so the files the customer sees are based upon a database of which accounts can see what files. The files are stored on the secure side of our network, and web serv...

C# DBMLs and SQL Server

Hello, My dev machine has SQL Server 2005 on it and that is how I make my DBML file and define the tables in there and then make a WCF Service. When i go to host the WCF service, the server has SQL Server 2000, it finds the connection string fine but not the table im pointing it to. Is there a way to tell through the web.config file whic...

WPF ListBox not updating with the ItemsSource

I have what I believe should be simple two-way databinding in WPF setup, but the listbox (target) is not updating as the collection changes. I'm setting this ItemsSource of the ListBox programmatically: lstVariable_Selected.ItemsSource = m_VariableList; And the ListBox is declared as follows: <ListBox Margin="5" Name=...

Microsoft Contracts: Assembly load resulted in metadata import warning

I'm trying to learn my way around the Microsoft Code Contracts libraries, and I have the following simple function: internal static Engine CreateBuildEngine(Microsoft.Build.Framework.ILogger logger) { Contract.Requires( logger != null ); var engine = new Engine { DefaultToolsVersion = "3.5" }; engine.RegisterLogger(logger);...

How can I put a lot of data from XML into my database quickly?

I am using .NET to parse an XML file with about 20 million lines (1.56 GB), building LINQ objects out of the data, then inserting it into a SQL database. It is taking a really long time. To improve performance I am considering asking for a pipe delimited file. I was also wondering if Perl might be any faster. Does anyone have sugge...

Quartz.NET server documentation

Hi, when downloading Quartz.NET it contains a server component with a console application. The website, faq and API documentation doesn't mention anything about it. Would anybody know more about it or know where I can find more documentation on it? Thanks, Patrick ...

How can I identify a file type from a blob/filestream?

We bought an "off the shelf" application a lonnng time ago that is capable of storing files as a blob within SQL Server. We've noticed that the database has more than doubled in size within the past six months due to more frequent usage of this blob field by one department. As a result, the application has become painfully slow. I'v...

Handling project references when using version control with multiple projects.

Say I have a repositry layout like the following: |Root |->CommonLib |->ProjectA.PartA |->trunk |->lib |->src //etc |->ProjectA.PartB |->trunk |->lib |->src //About four more projects. Now I split them up like this so that I can work on each diffe...

Is there a way to specify the Date Format used with SQLServer Management Object Scripting

When I'm generating my database scripts for my project I'd like to manage the date format that is used in the comments in the SQLScript. I have my regional settings set to Australian format, but they seem to be disregarded. Imports Microsoft.SqlServer.Management ... Dim scr As Smo.Scripter Dim opt As Smo.ScriptingOption...

Java client calling WSE 2.0 with DIME attachment

I need to integrate with a legacy .NET Web Service that uses WSE 2.0 for WS-Security and DIME. The catch is I need to do this from a Java application. I'm expecting that Axis2 works fine with the WS-Security because folks around here have done it before. It's the DIME that I'm concerned about. I see a reference to DIME at http://ws.apac...

adding controls dependent on sql table??

Hello all I'm working on a little project where I'm adding controls to a page based on a SQL table of questions, this table will grow overtime. I just wanted to share the code and see if there was any better way or if any of the experts could chime in and give me any insight on future problems. Here is the code: protected void P...