how to cast ?

Posts   
 
    
betux
User
Posts: 7
Joined: 22-May-2006
# Posted on: 18-Jul-2006 20:17:40   

hello,

i want to update a field ("ConvB") in a table MamConv.

first i do this ; MamConvEntity conv = new MamConvEntity((string)Session["idconv"]);

now i need to cast this string "conv1.ConvBesoin" in a type of MamConvEntity field to do that ;

(cast??) conv1.ConvBesoin = tbx_ConvB.Text;

and after save();

Is it possible ?

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 19-Jul-2006 02:28:20   

You shouldn't need to do any casting if the field type in your database is a string.

MamConvEntity conv1 = new MamConvEntity((string)Session["idconv"]);
conv1.ConvBesoin = tbx_ConvB.Text;
conv1.Save();