.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

How would you handle this? Multiple instance of a custom class...

Posted By:      Posted Date: September 26, 2010    Points: 0   Category :.NET Framework

Forgive me if this isn't the appropriate place.

I have the following data.

10484	1	30	0.5011	0.4630	0.5254	0.0081	10.8362
10484	1	30	0.5061	0.4666	0.5363	0.0075	12.2901
10484	1	30	0.5051	0.4688	0.5383	0.0060	12.5718
10484	1	30	0.5064	0.4623	0.5352	0.0074	12.9344
10484	2	30	0.5035	0.4637	0.5371	0.0074	13.1082
10484	2	30	0.5092	0.4726	0.5397	0.0075	11.7046
10484	2	30	0.5051	0.4645	0.5368	0.0060	13.1261
10484	2	30	0.5062	0.4642	0.5392	0.0081	13.2161

 I am using the following class.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace CvasAdmin.Classes
  public class invitro
    public class invitroDetail
      // pk of the foxpro Dbf
      public double sampleid;

View Complete Post

More Related Resource Links

How to implement custom HttpContext for each request under class that implements IHTTPHandler


Hello All,

I created an application and implemented IHTTPHandler for all incoming request ending with ".aspx" extension.

Under "ProcessRequest" module, I am creating an instance of HttpContext (with URL attributes different from my application's URL i.e. if I am working on localhost then speciying Yahoo.com as its URL) and assigning it to "context" which comes as method argument.

After redirection, an error is generated. Also, the custom HTTPContext is not passed to the requested page (default.aspx, in my case.)

Code is as follows.

    Public Sub ProcessRequest(ByVal context As System.Web.HttpContext) Implements System.Web.IHttpHandler.ProcessRequest
            Dim requestedUrl As String
            Dim targetUrl As String
            Dim urlLength As Integer
            'Save settings which will be used while redirecting to appropriate page
            requestedUrl = context.Request.RawUrl
            If requestedUrl.IndexOf("?") >= 0 Then
                targetUrl = requestedUrl.Substring(0, requestedUrl.IndexOf("?"))
                targetUrl = requestedUrl
            End If
            If targetUrl = Nothing Or targetUrl.Length = 0 Then
                targetUrl = requestedUrl
            End If

Building a Custom Data Grid: Performing Ad Hoc Web Reporting with a VBScript 5.0 Class Object


A flexible, customizable grid for displaying data is a useful tool for ASP developers. It allows Web visitors to customize their view of your data. This article takes the data grid presented in "Ad Hoc Web Reporting with ADO 2.0" by John Papa and Charles Caison (MIND, December 1998) and adds handy features such as a finds feature that supports multiple finds and a mode for adding and editing records. This version also improves response time by allowing asynchronous record download and it componentizes the code so it can be used as a standalone VBScript class object that can be reused in other pages.

Randall Kindig

MSDN Magazine July 2000

Multiple forms on the same page MVC2: how to handle (including validation from model)



It should be simple; although I'm having a hard time to figure out the best way to do it. I've MVC2 pages with multiple forms on the same page having different functionalities.

What's the best way to handle this; including the MVC2 way of validation from the model?


How do you create a custom BDC data field that allows for multiple selected values?

I need help creating a custom data field using the BDC column as a base.  We need to allow for multiple selected values instead of just a single one.  I can't find anything on the net which shows how to do this.

BinaryFormatter, SortedSet base class and a few instance variables.

/* This example successfully serializes and deserializes the SortedSet<string> base contents, but all the instance variables show up uninitialized. Here's the output: n1: 0 n2: 0 str: s == "String 1" s == "String 2" s == "String 3" Any ideas? */ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.Serialization.Formatters.Binary; using System.Runtime.Serialization; using System.IO; [Serializable] public class MyObject : SortedSet<string> {     public MyObject() : base() { }     protected MyObject(SerializationInfo info, StreamingContext context)         : base(info, context)     {     }     public int n1 = 0;     public int n2 = 0;     public String str = null; } namespace BasicBinarySerializationInheritanceFromSortedSet {     class BasicBinarySerializationInheritenaceFromSortedSetTest     {         static void Main(string[] args)         {             {                 MyObject obj = new MyObject();   &nb

Creating a Validator class for a custom activity

I created a new Workflow Activity Library and then added a new Activity called BindForm2Activity. After that I added a new class called BindForm2Validator and then placed an attribute to the BindForm2Activity to link it to the validator class.   Here is the code for each of the classes:   BindForm2Activity.xoml.cs: Code Snippet   using System;using System.ComponentModel;using System.ComponentModel.Design;using System.Collections;using System.Drawing;using System.Linq;using System.Workflow.ComponentModel.Compiler;using System.Workflow.ComponentModel.Serialization;using System.Workflow.ComponentModel;using System.Workflow.ComponentModel.Design;using System.Workflow.Runtime;using System.Workflow.Activities;using System.Workflow.Activities.Rules; using FormsCollection;using Utils; namespace ActivityLibrary{    [ActivityValidator(typeof(BindForm2Validator))] public partial class BindForm2Activity : SequenceActivity {        public static DependencyProperty FormToBindProperty = System.Workflow.ComponentModel.DependencyProperty.Register("FormToBind", typeof(FormsCollection.Form2), typeof(BindForm2Activity));         [Description("Form to bind a datasource to it ")]        [Category("BindForm2ToDataSource")]        [Browsable(true)]        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]        public FormsCollection.Form2 Form

WCF Multiple Custom Assemblies in IIS7

Hi, I have a WCF service library that references a few sub-assemblies.  As an example, I have a service layer assembly and a business layer assembly.  When I attempt to deploy into an IIS 7 host, I keep getting the error: assembly 'business layer' could not be loaded.  Both the assemblies are in the bin directory and neither are in the GAC.  I'm trying to avoid introducing them there.  Is there somewhere in IIS or the web.config that I could update to tell it where to load the sub-assemblies? Please note that as a test, when I took out the reference to the business layer, the service compiled and was consumed by a test client successfully. Thanks, Kyle

Storing multiple data types in a class?

I need help writing a class that will contain three values per item.  I'll be passing parameters to a report: Parameter Name, Data type (int, string, date, etc), and Value. When I pass those values to the report using the class they should be in original form (i.e. an integer should be a numeric, a string should be a string, etc.).  I can do it converting the data's value to strings on one end, and reconverting to the original data type on the other, which seems like a lot of runaround. Is there a simple way?  Also, if I'm able to store & retrieve the data in it's native format I don't need the "Data type" stored. Any help or tips will be appreciated.

Custom List Row association to multiple documents - Design choices?

I want to associate custom list entries to muliple documents. Thinking about options.   1 row will have many docs, but one doc will only have one row. Possible? Trying to keep it simple with minimal development. I was thinking I could have a unique column or the id column in the list act like a key (somehow).. and  add a required column to the document list requiring it to tie back to the list entry.  Then a view could drive listing all the docs for a particular row from a link in the list built in a custom dataview. All the docs could be in the same library. Is the the best approach? Ideas/suggestions? Thanks.

Custom markup extension or custom binding class?

Hey experts! I'm doing a project where I've encountered an issue I'd love some feedback on. I've created a custom Markup Extension called MyMarkupExtension, with two properties.  I can use it like below: <cc:DialogBorder Title="{local:MyMarkupExtension MyProperty='property value goes here', AnotherProperty='and another value here'}"> It works, and in 99% of the cases, it fits my needs perfectly.  In 1% of the cases, the values of MyProperty and AnotherProperty can not be set at design time, so I'd need some binding there. <cc:DialogBorder Title="{local:MyMarkupExtension MyProperty={Binding Path='SomePropertyOfTheViewModel'}, AnotherProperty='and another value here'}"> This presents my two questions (yes I did make only one post for 2 questions, bad karma...): 1. the binding inside my markup is not legal, after all, a binding can only be set on a DependencyProperty.  Is there any workaround which I could use for this problem at hand? In case there isnt... 2. I'm thinking about dropping the markup extension and creating a custom binding instead.  For this, I'd have to inherit from bindingbase, and so far I've read online that's one ____ of a nightmare.  Does anyone have some good code / examples on where to start? "The improbable we do, the impossible just takes

Multiple databases on same instance - performance hit?

Hi I am not a SQL person to please excuse me if my terminology is wrong :) We are running SQL 2005 at the moment on Windows 2003 SP2 servers. We have multiple SQL servers spread around in each of our data centres. We have an application we're going to be bringing in that needs it's own SQL database. We need to decide whether we build a dedicated SQL server for this or just create a new database on an exisiting SQL instance. The advantages of the former are that we don't max out any existing servers and affect the performance of other databases, whereas with the latter we save the cost of having to build a new server. For those of you that use SQL heavily, what's the general way of doing things? I know that SQL is memory, disk intensive etc so not sure.

Unable to create instance of proxy class in WCF

Hello, I created proxy class using svcutil.exe and added it in App_Webreference folder. I want to access objects and methods from this proxy. But I am unable to create instance of this proxy class. In inellisence, it is not showing this proxy class. What could be the problem ? I am using VS 2008 and Visual Basic.   Thanks in advance.  Amit Lohakare

Sending Array of Custom Class over WCF Problem

I have been attempting to convert some service calls that returned a DataSet into something more lightweight. For instance, I am converting: [OperationContract] public DataSet GetCommittees(); into: [OperationContract] public List<VolunteerCommittee> GetCommittees(); where committee is defined as: [DataContract] public class VolunteerCommittee { [DataMember] public int Id { get; set; } [DataMember] public String Name { get; set; } } I copied the structure of the data contract and the operation contract right from an example in a book I bought on WCF. The author mentioned that the List<VolunteerCommittee> would get converted into an array over the wire, so the client's operation contract looks like: [OperationContract] public VolunteerCommittee[] GetCommittees(); My problem: When the service is called, an empty array is returned every time. When I put trace statements in, I see an array of 48 VolunteerCommittees leaving the server. I've done some reading on the problem and tried a number of suggestions, such as using the XmlSerializer attribute, including a certain namespace as a [return:] on the server's contract, changing the type of binding (it's using wsHttpBinding... I tried basicHttpBinding) and turning off MTOM in the behavior, but none of these changed the empty result of the call. At this point, I'm hoping someone can shine some light on

Custom Web Part deployment with class library reference

Hi All, We have class library as a project in our solution as well as a web part project. Our web part simply references and executes a service utility class in the class library and outputs it into a label. The deployment is successful but when attempting to add the web part to the page, it comes out with a error page saying "File Not Found" with a correlation ID and date/time reference. Once we take out the code that executes the utility class, it deploys fine and we're able to add it to the page without any issues. It seems evident that any reference to our class library causes this "File Not Found" issue... but we're not sure how to implement this solution. Any ideas? Do we add the class library dll directly into the GAC?  If so, how? Is there another reference we have to implement in the AssemblyInfo.cs?  If so, what does that look like? Any help is appreciated. Thanks, Eric

How to use single windows service to host multiple WCF Services instances (Each instance of WCF is i

How to use single windows service to host multiple WCF Services. I have a mutiple instance of same WCF service in different folder, each instance has unique service name and port. WCFService has reference to Reg-Free COM Reference, i have Native.WCFService.manifest in each folder. Ex: WCFService1 is in "C:\WCFService01\WCFService.dll, Native.OCWCFService.manifest, OCWCFService.dll.config WCFService2 is in "C:\WCFService02\WCFService.dll, Native.OCWCFService.manifest, OCWCFService.dll.config Now i need host above services from single Windows Service. I am trying to create AppDomain for each above WCFService Instance from Windows Service and then host. Its working if i register COM dll in the server using regsvr32, but when i un register COM dll, i am getting unable to load COM component .... This looks like AppDomain is not loading COM DLL and Manifest files. Its looks strange but we need it in this way because we have production and test environment in the same server. Everything works fine if create a seperate Windows Service for each WCFService Instance, but my manager wants single Windows Service :). Any help whould be really appreciated.  ravi kumar reddy

Rebooting one Instance on a SQL 2008 Server with multiple instances installed

Hello, Hoping someone can answer the following questions ... If I have SQL Server 2008 with multiple Named Instances configured on it, can I reboot one Named Instance without rebooting any of the other Named Instances, or without having to reboot the entire server ? For example, if I have an application that needs to be re-booted and it requires the Database to be re-booted. Regards, JD

Installing multiple instances of SQL Server R2 creates permissions issues - first instance won't st

After installing two named instances of SQL Server 2008 R2 DataCenter edition (R2D2 and C3P0) I found the first instance would no longer start.  The errorlog showed the reason to be an invalid path. 2010-09-14 18:15:39.12 Server      Error: 17113, Severity: 16, State: 1. 2010-09-14 18:15:39.12 Server      Error 3(The system cannot find the path specified.) occurred while opening file 'C:\MSSQL\SQLDAT\MSSQL10_50.R2D2\MSSQL\DATA\master.mdf' to obtain configuration information at startup. An invalid startup option might have caused the error. Verify your startup options, and correct or remove them if necessary. Finding the files in the proper location I check the ACLs and found the Local Group created for the second instance on the ACL for the first instance.  That is to say for instance R2D2 I found MSP-JANHONJ7\SQLServerMSSQLUser$MSP-janhonj7$C3P0 instead of the MSP-JANHONJ7\SQLServerMSSQLUser$MSP-janhonj7$R2D2 that was originally there. C:\MSSQL\SQLDAT\MSSQL10_50.R2D2\MSSQL\DATA>icacls master.mdf master.mdf NT AUTHORITY\SYSTEM:(F)            BUILTIN\Administrators:(F)            MSP-JANHONJ7\SQLServerMSSQLUser$MSP-janhonj7$C3P0:(F) It seems that creating the second instance causes this problem.  I have been u
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend