473,386 Members | 1,830 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,386 software developers and data experts.

How to Run a Code Stored in String

hi all

how do I get the compiled value of the code stored in a string?

For instance:-
dim strVal as String = "Response.write(1)"

I want the code stored in the string to be executed and when in print the string it shld return me the value '1'. is this doable? any help?

Regs,
Bharani Dharan
Windows Live Butterfly
Oct 31 '07 #1
4 1590
On Oct 31, 6:21 am, "Bharani Dharan" <pbdha...@hotmail.comwrote:
hi all

how do I get the compiled value of the code stored in a string?

For instance:-
dim strVal as String = "Response.write(1)"

I want the code stored in the string to be executed and when in print the string it shld return me the value '1'. is this doable? any help?

Regs,
Bharani Dharan
Windows Live Butterfly
You'll want to look into CodeDom to compile and execute your code.

--
Tom Shelton

Oct 31 '07 #2
Thnx for the reply

I didn't get clearly as im at the beginner level is it possible for you give explanation more on this and wil tat work in Framework 1.1?

thnx again

Regs,
Bharani Dharan
Windows Live Butterfly
"Bharani Dharan" <pb******@hotmail.comwrote in message news:B4**********************************@microsof t.com...
hi all

how do I get the compiled value of the code stored in a string?

For instance:-
dim strVal as String = "Response.write(1)"

I want the code stored in the string to be executed and when in print the string it shld return me the value '1'. is this doable? any help?

Regs,
Bharani Dharan
Windows Live Butterfly
Oct 31 '07 #3
Bharani,

You are in this case working at the server side, while you want to do something at client side.

Here a sample how you can do things as you want.

http://www.vb-tips.com/AstroBoys.aspx

However in your case it can much simpler.

If you want to show 1 on a page, then set an aspbet label on it, and set in your server side code (you call this probably code behind)

Mylabel = "1"

Cor

Nov 1 '07 #4
thnx cor.

tat was a gr8 help.

Regs,
Bharani

--

Regs,
Bharani Dharan
Windows Live Butterfly
"Cor Ligthert[MVP]" <no************@planet.nlwrote in message news:51**********************************@microsof t.com...
Bharani,

You are in this case working at the server side, while you want to do something at client side.

Here a sample how you can do things as you want.

http://www.vb-tips.com/AstroBoys.aspx

However in your case it can much simpler.

If you want to show 1 on a page, then set an aspbet label on it, and set in your server side code (you call this probably code behind)

Mylabel = "1"

Cor

Nov 1 '07 #5

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

Similar topics

2
by: Tavish Muldoon | last post by:
What a pain trying to insert data into a table from a stored proc. My webform asks for 16 pieces of data - which then gets written to the database. I found this easier than the crap below...
4
by: Rhino | last post by:
Is it possible for a Java Stored Procedure in DB2 V7.2 (Windows) to pass a Throwable back to the calling program as an OUT parameter? If yes, what datatype should I use when registering the...
5
by: Raquel | last post by:
This is a very simple DB2 SQLJ stored procedure. The problem is that it seems to run fine but returns NOTHING. I mean..as if nothing has happened..not resultset is returned. I am passing value...
11
by: Tim Smallwood | last post by:
Hi, I have an Access project that I use to allow a client to hit an SQL server at my host. This project has several forms that are used to udpate tables, etc, but I'd also like to be able to...
18
by: Joe Fallon | last post by:
I have some complex logic which is fairly simply to build up into a string. I needed a way to Eval this string and return a Boolean result. This code works fine to achieve that goal. My...
6
by: Lelle | last post by:
Hello ! how can i insert text containg code examples from a textbox into a database using SQL insert statment. i have no problem to just add text that dont contains code and script examples...
2
by: Stephen Noronha | last post by:
Hi, I get an error "System.Data.SqlClient.SqlException", after my Stored Procedure runs and i saw an article for debugging through the Stored procedure using VS .Net....
17
by: | last post by:
I have an app that retrieves data from an Access database. At the moment I have the SQL string as a Const in my app. I understand this is not best practice. I don't want the user to have access to...
3
by: andrewkl | last post by:
hi, I have the following Perl code that inserts a string to an Oracle DB via a stored procedure: #!/usr/local/bin/perl ## Perl v5.8.6 built for sun4-solaris use strict; BEGIN...
0
by: mirandacascade | last post by:
Questions toward the bottom of the post. Situation is this: 1) Access 97 2) SQL Server 2000 3) The Access app: a) sets up pass-thru query b) .SQL property of querydef is a string, the...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.