.net - Implement A Formula Factory?

Jul 3, 2009

First the requirements: By management requirements, I can't use open source code. I need the users to define their own formulas for a project. My users don't know how to code. The formulas need to be saved somehow, and being read later. I need to debug the formulas written, so I need to be able to see and understand them. The formulas used are quite specialized and specific (actuarial formulas). Adding new formulas (functionality) must be done in fast and maintainable way.

[Code].....

View 2 Replies


ADVERTISEMENT

Implementing Radio Buttons - Select One Of Them To Use One Formula, And Then Select The Other To Use Another Formula

Feb 20, 2009

I want to place two radio buttons in so I can select one of them to use one formula, and then select the other to use another formula. I want to use the I=P(1+r)^n formula and I=P(1-r)^n formula with the radio button text showing Appreciation and Depreciation.

Heres my copy of the original code.

Public Class Form1

Private Sub cmdExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdExit.Click
End
End Sub

[CODE].......................

View 5 Replies

Asp.net - When Should The Factory Pattern Be Used

Jun 22, 2009

when should a trigger in your head go off signifying "Aha! I should use the factory pattern here!"? I find these moments will occur with many other design patterns, but never do I stop myself and think about this pattern.

View 6 Replies

C# - WCF, Channel Factory, And Exceptions?

Feb 2, 2010

Using vs2008, vb.net, C#, fw 3.5

I am consuming my service in my client

Service is hosted in IIS

Client(winforms MDI) is generated using svcutil using /l, /r, /ct, & /n switches

Service and client both use a MyEntities.dll

I am using nettcp with TransportWithMessageCredential. I cache the proxy in the main form

if Membership.ValidateUser(UsernameTextBox.Text, PasswordTextBox.Text)
_proxy = new MyServiceClient
_proxy.ClientCredentials.UserName.UserName = "username"[code].....

Could I subscribe to the _proxy.InnerChannel.Faulted and do that clean up there?

View 2 Replies

Get The Factory Or Unique Id Or Serial No Of The Scanner?

Sep 20, 2011

In Motorola MC55, I'd like to get the factory or unique id or serial no of the scanner. How to code it in vb.net?

View 1 Replies

Handling Task Factory Exceptions?

Apr 18, 2011

I have set up a process to create new tasks to handle file processing. A problem arised where I received and unhandled exception error and just clicking on the continue button, the main process continued to run. Now I also found that within the child task I was having a file conflict error and as the tasks run as separate .exe i was under the impression that everything would have been thread safe. So for the first issue here is the task creation in the main process..GProcess is a complete project on its own consisting of 6 classes. This is added as a class library reference to the main process class form1

Public Class Form1
..Private parser as GProcess.module = new GProcess.module()
dim factory as new taskfactory

[code].....

View 1 Replies

Retrieving The COM Class Factory For Component

Feb 22, 2011

I have integrated the innovative gateway (third party payment gateway) into our asp.net ( language vb.net) web application. while doing transation we are getting the following error in server.

Server Error in '/' Application.

Retrieving the COM class factory for component with CLSID {7A1284E2-7E00-46B5-8440-FC28305E6A27} failed due to the following error: 80040154.

But in my localhost am getting the failure transaction without getting any error.

View 11 Replies

Syntax Task.Factory.StartNew?

Jun 13, 2011

I am trying to start a new thread in VB.Net and having syntax problems.In C# this is we can do the same task using

var manualResetEvent = new ManualResetEvent(false);
waitHandles.Add(manualResetEvent);
var taskOne = Task.Factory.StartNew(() => new Thread(TaskToRun).Start(manualResetEvent));[code]....

where TaskToRun is a void method with a single object parameter.All online converters generate similar code to this

Dim manualResetEvent = New ManualResetEvent(False)
waitHandles.Add(manualResetEvent)
Dim taskOne = Task.Factory.StartNew(Function() New Thread(AddressOf TaskToRun).Start(manualResetEvent))
taskOne.Wait()

View 1 Replies

Use Object Initializers In A Factory Pattern?

Mar 30, 2012

I have written a base class from which I wish to derive several child classes (in this case Windows Form classes), and I'm using a Factory pattern in order to maintain a collection of the child instances, so that a form can only have one instance per primary key value. (sort of a mash-up of Factory and Singleton patterns.)

I'm using the following code in the base form class[code]...

View 2 Replies

Access Wcf Service By A Client Using Channel Factory?

May 6, 2011

I tried this one...but its not working.[code]...

View 1 Replies

Change This Code To Make The Factory Dynamic?

Feb 12, 2011

How would I change this code to make the factory dynamic. I believe I was close with remoting. I don't want any hardcoding of the factory, nor do I want to have to recompile. The database drives it.

Dim genericRule As Rule
Dim factoryObject As String
factoryObject = _dal.GetFactoryObject(ruleId)

[code]....

View 1 Replies

Error 80040154 Retrieving COM Class Factory

Sep 26, 2006

I have a VB.NET application that references a 3rd party Com component. The file is Interop.WINTSRRLIB.dll. My VB.NET application has a project reference to the COM comonent which lives in the directory: C:WaveTracker. The application runs fine. When I sent it to my customer, he installed in on his desktop machine. It runs fine. Then he copied all of the application files (which live in C:WaveTracker) to his laptop. However, on his laptop, he gets the error:

"System.Runtime.InteropServices.COMException (0x80040154). Retrieving the COM class factory for component xxxx failed due to the following error: 80040154" The customer swears he has the .NET 2.0 Framework installed properly on his laptop. Any ideas on how I can get over this problem???

View 1 Replies

How To Create Factory Object That Does Not Cause Infinite Loop

Jan 27, 2010

Whenever I try to create a new CD object I get a stack overflow. I want a parameter to be passed into mediaFactory so that it could be determined what type of media is created. Why I might be having problems with this when I do this
"Dim media As CD = New CD()"
Public MustInherit Class MediaFactory
Inherits MediaContext
Implements IMedia
Public Sub New(ByVal typeId As Integer)
[Code] .....

View 2 Replies

Sql Server - Provider Factory Command Timeout - How To Set It

Feb 4, 2011

I am having a problem with a SQL server query giving a timeout error. I read about setting the timeout value of the command object but in my DAL, I do not see how to do that. Here is how I create the command object

Public Sub Init()
If ConnString = "" Then
Select Case ConnStringID

[Code]....

View 1 Replies

Suppress Obsolete Warning On Factory Method In .net

Apr 30, 2009

Is it possible to prevent compiler warning caused by a static factory method returning an instance of an obsolete class? For example if an instance of an obsolete class (Foo) is created through a static method (Create) a compiler warning is caused by the factory method.

<Obsolete()> _
Public Class Foo
Public Shared Function Create() As Foo

[code]....

In C# the warning could be suppressed using "#pragma warning..." but I don't think that this exists within VB.Net. Migrating to C# is not an option due to business requirements.

View 2 Replies

Suppress Obsolete Warning On Factory Method In .net?

Jan 21, 2011

Is it possible to prevent compiler warning caused by a static factory method returning an instance of an obsolete class? For example if an instance of an obsolete class (Foo) is created through a static method (Create) a compiler warning is caused by the factory method.

<Obsolete()> _
Public Class Foo
Public Shared Function Create() As Foo

[code]....

In C# the warning could be suppressed using "#pragma warning..." but I don't think that this exists within VB.Net. Migrating to C# is not an option due to business requirements.

View 1 Replies

Find A Good Database (factory) Class With Connectionpooling?

Aug 12, 2009

I found a lot of information about how to make a database factory or how to deal with connection pooling but i nowhere found a complete solution.I have always used my own solutions, but they're not complete i think or could be improved.Are there some good designed classes any of you use that i can find on the net?

View 1 Replies

Retrieving COM Class Factory For Component With CLSID. 8000401a

Aug 26, 2011

I created a VB.NET application that takes in parameters from a javascript file, uses those parameters to then retrieve info from a database, then send back to the javascript. When I locally test the webservice however, this is the error message I get:Retrieving the COM class factory for component with CLSID {C2C0AFBE-102A-4A8D-A792-06B4063E863F} failed due to the following error: 8000401a.Everything I've googled on the error says it has something to do with the either a word or excel file... which the process has nothing to do with neither. [code]

View 7 Replies

Using Abstract Factory Pattern In Module Console Application

Mar 1, 2011

[code]I want to write a simple text based rpg game very simple that uses the abstract factory pattern. It will be a choose your own adventure style read and options like 1.run 2.fight 3.bribe your way out of it 4.talk your way out of it, really simple. Would i create a thing pattern, then have factorys like creatures, items etc.

View 5 Replies

80040154: Retrieving The COM Class Factory For Component With CLSID Error In .NET?

Aug 31, 2009

I am getting the below error while i am using Microsfot excel interop. In my server there no excel installation. With out excel installation i want to export data to excel. So i used excel interop. But i am getting the below error.

Error: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80040154.

I am using the below code. It is working, if the machine have excel installation, But i dont have excel installation in my server.

Dim lobjExcelApp As Excel.Application
Dim lobjExcelWrkBk As Excel.Workbook
Dim lobjExcelWrkshtFee As Excel.Worksheet
Dim lobjsht As Excel.Worksheet

[code]....

View 6 Replies

Getting Error "Retrieving COM Class Factory For Component With CLSID?

Feb 1, 2010

I have created a small SMS apllication with Windows application.Ihave used two dll called "lcgsmsms" and "Interop.excel".But even after adding all those dll ,while building my aplication

(1)it shows ambiguous column name and after debugging ,
(2)It shows SQL server could not connect remote connections and
(3)getting error "Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80040154."

View 1 Replies

MSComm Installation - Creating An Instance Of The Com Component With CLSID - IClass Factory Failed

Feb 19, 2009

Iam working with VB.net. I have used MsComm6.0 control in VB.net. It is working properly on my machine.But when i installs in a system in which .net is not installed it is giving an error

[Code]....

View 4 Replies

Retrieving The Com Class Factory For Component With Clsid Failed Error: 80040154 ADOX/?

Dec 18, 2009

I have a line of code that is producing the error: Retrieving the com class factory for component with clsid failed error: 80040154 ADOX The line of code is:

Dim
ADOXTable As New ADOX.Table

This error only occurs on one computer.

View 3 Replies

Add Formula In Database

Jun 2, 2011

check the attached 2 file. one is .docs file another is .bmp file. Problem is that i want add that formula in database through vb.net. what will be data type in sql serve? and how to manage in vb.net??

View 1 Replies

C# - Calculate A Formula Which Changes Value Each Day?

Feb 25, 2009

I use the following columns stored in a SQL table called tb_player:

Date of Birth (Date), Times Played (Integer), Versions (Integer)

to calculate a "playvalue" (integer) in the following formula:

playvalue = (Today - Date of Birth) * Times Played * Versions

I display upto 100 of these records with the associataed playvalue on a webpage at any time.

My question is, what is the most efficient way of calculating this playvalue given it will change only once a day, due to the (today-date of birth) changing? The other values (times played & versions) remain the same.

Is there a better way than calculating this on the fly each time for the 100 records? If so, is it more efficient to do the calculation in a stored proc or in VB.NET/C#?

View 2 Replies

Converting Formula In C To .net?

Oct 9, 2009

I am reproducing a program written in C to vb.net and I am getting different results on a math formula. I am sure it is something simple that I am overlooking. Here is the formula in C

num = (10 * 9 * 80900 * 0501) & 0xffff;

Here is the same formula in vb.net

num = (10 * 9 * 80900 * 0501) AND &HFF

View 3 Replies

How To Generate The Formula

Apr 1, 2009

how to generate the formula. want to use arraylist to store and for loops to loop the formula til the system can detect which staff it should giv the ticket to..below is the scenario:this is a helpdesk system..so each ticket they submit muz be auto assigned to a staff to attend their ticket..each staff has a different quota..so i came out wid this algorithm on hw to determine who the ticket shld go to..

for ex: i set one ticket's quota is 7%

staff A's quota - 47% staff B's quota - 35% staff C's quota - 18% so to knw how many tickets A get den B getx 1 ticket and how many tickets B get den C gets 1i came out wid a calculation like this -

Staff A - 47% / 7% = 6.7(max no.of tickets he can receive foe a period of time)
Staff B - 35% / 7% = 5
Staff C - 18% / 7% = 2.5

so first i compare A&B whr i took 6.7/5 = 1.3 -> so every 1.3 ticket A gets,B gets 1 ticket den i compare B&C whr i took 5/2.5 = 2 -> so every 2 ticket B gets,C gets 1 ticket i wanna implement this concept in my code..but i dunno how to come up wid this formula..

View 14 Replies

Better Decimal To Binary Formula?

Apr 25, 2012

I need a code that will convert decimal to binary. My current code doesn't work and just crashes, any suggestions on what I should do

For i = 1 To 17
Me.lstDec.Items.Add(i)

[code].....

View 3 Replies

Calculate Values From Formula?

Oct 11, 2011

Using VB.Net (Windows Application)[cod]e...

f1 = a + b * c means i have to pass the value a = textbox1.text, b= textbox2.text, c = textbox3.text

View 1 Replies

Convert Excel Formula?

Jun 11, 2010

I have a formula, found in an Excel sheet that I have to convert to vb.net...I can't figure it out, eventhough it's seems a quite easy formula to me.the formula is: Mod(X + Int(Y/100000);20)In fact if I render some values...and use the Mod function in Excel or in VB.NET it gives me other results.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved