.net

Nested MasterPage in SharePoint not working

I have a SharePoint 2007 Server and want to create a site with a nested Master Page. I created a new Master Page, test.master: <%@ Master MasterPageFile="~masterurl/default.master" %> <asp:Content ID="Content1" ContentPlaceHolderID="PlaceHolderMain" runat="server"> Test123 <b> <asp:ContentPlaceHolder runat="server" ID="Test...

Calling .Net Classes from Visual Basic 6

We have a .Net DLL. We need to call this DLL from a VB Application. What are the procedures we need to follow? ...

How to write a cql query for LOC server ?

How to write a cql query for LOC server ? I am trying to retrieve data from loc server using z39.50 and YAZ dll. Following is the code query = "Author=" + txtAuthor.Text.Trim() + " and Title=" + txtTitle.Text.Trim() + " and Publisher=" + txtPublisher.Text.Trim(); but i am getting error that the syntax of query is wrong although the tex...

Is OpenID too complicated?

I'm beginning to seriously doubt the OpenID community despite that fact that it works. I'm in the process of currently evaluating OpenID as an authentication service for 'this' site and while the promises are great, I just can't get it to work. And I'm really lost. I ask of the SO community to help me out here. Give me answers and show...

NHibernate: Do you always have to commit, and what does it actually do on read?

I'm using NHibernate to communicate with the database in my C# .NET project. When communicating with the database - do I always have to commit the transaction? What does this actually do when doing reads? I find myself forgetting to commit occasionally when doing reads, but everything seems to work fine. using (var tx = Session.BeginTr...

Why is MailMessage sent to any adress from Windows Forms application, but not from ASP.NET application, when both are using the same SMTP-server?

Hi, I'm experiencing a to me mysterious error when sending e-mails through a SMTP-server from an ASP.NET web application. I get the famous error "unable to relay for [email protected]". What's mysterious to me is that when I cut and paste the exact same code that sends the e-mail into an usual .NET Windows Forms application, send the e-mail ...

Should I use FxCop and why?

I'm working on a project in C# .net and WPF. We're using StyleCop to help bring a consistent style to the project, and after disabling some rules we're quite satisfied with it. However, I've heard people talk about FxCop, and that this would bring value to the project too. From what I understand this is more on a code structure base..? ...

Conditional HttpHandler: how to make certain requests return the default response?

I'm working on an IHttpHandler implementation which will handle all *.gif files. The Handler itself will have code in it to check whether the *.gif files are requested from a certain URL. If this is the case, some customer logic should be performed to put a customer gif in the response. But I don't know what to do when a regular gif is ...

Linq-to-SQL: how to handle database changes

I have several installations of my Linq-to-Sql app running in the field. Now I've created a new version, which adds a new column to a certain table. I've added this column in the dbml file. But when updating the installation, I want to preserve the existing database. How to handle this? Linq-to-SQL doesn't seem to like this inconsistency...

How to bind Combobox Datasource with an other column name from bindingsource?

Hello, Is there a way to bind Combobox datasource with an column from bindingsource? The following example works fine: //fill combobox with some data cBox.DataSource = dataSetOne.Table[0]; cBox.DisplayMember = "columnA"; cBox.ValueMember = "columnB"; //bind columnB from dataSetTwo with combobox cBox.DataBindings.Add("Text", dataSetTw...

Making a reusable predicate for EntitySet<T>, IQueryable<T> and IEnumerable<T>

In my LINQ to SQL setup I have various tables which are mapped to classes which basically support the same interface to support versioning, i.e. public interface IValid { int? validTo { get; } int validFrom { get; } } The LINQ to SQL classes derive from this interface like this: public partial class representationRevision : I...

Why can't reference to child Class object refer to the parent Class object?

I was explaining OOP to my friend. I was unable to answer this question. (How shameful of me? :( ) I just escaped by saying, since OOP depicts the real world. In real world, Parent's can accommodate children but children cannot accommodate parents. same is the case in OOP.I know its stupid. :P class Parent { int prop1; int prop2; ...

Linq query-dateOfBirth to age

Is is possible to turn a dateOfBirth in a linq query to an age within the query so i can do a comparison to an int? Cheers in advanced Truez ...

I need a special serializer (C#)

Hey everyone, I am looking for a serializer that will match my requirements, the serializer can be in the .Net framework, an Open-Sorce or a pay-for product (as long as it can b used directly from the code). now, my requirements are these: mandatory Able to handle a cyclic reference. Automatic, usues either attribute or inheritance ...

C# attribute name abbreviation

How is it possible that C# attributes have "Attribute" in their name (e.g. DataMemberAttribute) but are initialized without this suffix? e.g.: [DataMember] private int i; ...

Path change for achieving the functionality

I have to get version value from registry, the path is HKEY_LOCAL_MACHINE\SOFTWARE\Secon\Secon Monitor. In that path we can see one file CurrentVersion which contain value. So i did this type of coding to fetch value There is one class file Simregistry.cs where all registry paths are registered.So there i registered one path as below ...

Calling .Net Classes from Visual Basic 6

Hi, I have a .net dll file. I have to call one of the methods in this dll file from a VB program. This dll file uses another .net dll file for logging purpose. I able to call a .net class library method from VB6 application. But, I am getting the exception that unable to load assembly (which is used for logging). How the vb6 applica...

How to get the logon SID in c#

Hi, How does one retrieve the Windows Logon SID in c# .net? (not the user sid, but the unique new one for each session). Thanks in advance, ...

I need to run a function everytime a module is requested using Prism in C# .net

Hello I am using Prism in an application and I need a way to run call a function every time a module is requested. The thing is that this function will query the database for some items, and I need to do this every time the module is requested by pressing the module item buttom from a menu. I tried adding this to the constructor, but th...

LINQ entity data model generated code error - The type 'DBContexts.Category' already contains a definition for 'ID'

Hi, I have two tables in my database - Category and Department which both contain the same columns - ID, Name and Code. I can create a new entity model using the Visual Studio 2008 designer and add the Department and it works fine - I can query the database using LINQ, alls good. When I update the model and add the Category table, th...