hi everyone
i'm novice in vb.net and got stuck with this problem

want to add a record in table and used the following code

Adodc1.Recordset.AddNew()
Adodc1.Recordset.Fields("UrduWord1") = rtfHindi.Text
Adodc1.Recordset.Fields("UrduWord2") = rtfUrdu.Text
Adodc1.Recordset.Update()

the problem is with the line:
Adodc1.Recordset.Fields("UrduWord1") = rtfHindi.Text

and showing following error msg

Error Property 'Item' is 'ReadOnly'.
Can anyone plz help me with this problem

Welcome shaikh_farahnaz.

Which version of Visual studio are you using? Your code uses vb 6.0 com control. Do you know there is a powerful class library in .net framework to work with database?

However use following code:

Adodc1.Recordset.AddNew()
Adodc1.Recordset.Fields("UrduWord1").Value = rtfHindi.Text
Adodc1.Recordset.Fields("UrduWord2").Value = rtfUrdu.Text
Adodc1.Recordset.Update()

Always post source code using bb code tags. Read How to use BB code tags?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.