473,408 Members | 2,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

How to read a string value from a table but have it interpreted as a C# custom function?

I have a SQL 2000 table with two varchar(50) string columns:
SEARCHCOLUMN VALUECOLUMN
ABC This is an example text
DEF getMyValue("TABLENAME1")
I have some code using SQL DataReader that searches for value "DEF"
and returns "getMyValue("TABLENAME1")"

My problem is how can I return basically
getMyValue("TABLENAME1")
instead of a string text of
"getMyValue("TABLENAME1")"

I am interested to have the function
getMyValue("TABLENAME1")
get executed and return me string value of "5" for example.

getMyValue being another C# function in my code.
Am I explaining properly what I want?

I appreciate your help.

Thank you
Mar 2 '06 #1
1 1097
Piece of cake. All you have to do is write a compiler, compile the code into
an assembly, and then use the assembly to execute the code.

Fortunately, Microsoft has given you a head start. You should start by
reading up on the System.CodeDom and System.CodeDom.Compiler namespaces.

Of course, if you are using a small set of functions in your table, you just
parse the string in VALUECOLUMN, and use a switch statement to decide which
function to call.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A brute awe as you,
a Metallic hag entity, eat us.
"serge" <se****@nospam.ehmail.com> wrote in message
news:cs********************@wagner.videotron.net.. .
I have a SQL 2000 table with two varchar(50) string columns:
SEARCHCOLUMN VALUECOLUMN
ABC This is an example text
DEF getMyValue("TABLENAME1")
I have some code using SQL DataReader that searches for value "DEF"
and returns "getMyValue("TABLENAME1")"

My problem is how can I return basically
getMyValue("TABLENAME1")
instead of a string text of
"getMyValue("TABLENAME1")"

I am interested to have the function
getMyValue("TABLENAME1")
get executed and return me string value of "5" for example.

getMyValue being another C# function in my code.
Am I explaining properly what I want?

I appreciate your help.

Thank you

Mar 2 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: | last post by:
If I need to check if a certain value does exist in a field, and return either "yes" or "not" which query would be the most effestive?
3
by: Bo | last post by:
I am using RegistryKey.GetValue() method to retrieve values from Windows Registry. I don't know how to read type REG_MULTI_SZ into a string array. I have tried string array = (string)...
4
by: Dennis Myrén | last post by:
Hi. Is there a way to utilize the great primitive data type formatting routines available in .NET without working with strings? I want a byte directly rather than a string. I think it is...
3
by: Programmer | last post by:
Hi all I wan't to know if i'm able to read mail from a mail server. My mail server is a pop3 server (UNIX) and i want to be able to get the mails from an aspx or an asmx. with out using external...
4
by: brent | last post by:
Currently our application is reading from the web.config, and retrieves a section, "softwareRequirements". Because the section will begin to grow dramatically, I'd like to place it in the SQL...
7
by: Shimon Sim | last post by:
I have a custom composite control I have following property
1
by: Paloma García | last post by:
Dear all, I have created personalized configuration sections in my web project following the instructions described in this page...
6
by: karthi | last post by:
hi, I need user defined function that converts string to float in c. since the library function atof and strtod occupies large space in my processor memory I can't use it in my code. regards,...
5
by: Henrik | last post by:
The problem is (using MS Access 2003) I am unable to retrieve long strings (255 chars) from calculated fields through a recordset. The data takes the trip in three phases: 1. A custom public...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.