Changing data type of a text box

G

Gaurav Bhardwaj

Hi,

Is it possible to change the data type of a text box, programmatically? I am
connecting my form to a database and displaying the values in a text box.
Can the data type of a text box be changed from Whole number (Integer) to
Text (String) according to the data returned?



Thanks,

Gaurav
 
F

Franck Dauché

Hi,

Sorry, there is no built-in access to controls from your code behind.

Regards,

Franck Dauché
 
A

Andrew Watt [MVP - InfoPath]

Isn't the datatype defined already in the database column? So don't
you know that at design time?

I could be slow today, but it's not obvious to me why you need the
feature.

Andrew Watt
MVP - InfoPath
 
G

Gaurav Bhardwaj

Hi,

I have created a form where in a user needs to run a query against a
database and the form will display the returned data in the text fields. At
design time i have taken the data type of the field as Text but the data to
be displayed can be Integer also. I would like to change the data type of
the text field on the basis of data returned.

Gaurav
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top