on 11-06-2007 10:15 AM
Hi All
i made a form using code , in this form has a one static field nd one edit text field , nd ok , cancel btn, i want to bind this field to usertable @valueo, i using this code for binding,
.................................
oEditText = ((SAPbouiCOM.EditText)(oItem.Specific));
// bind the text edit item to the defined used data source
oDBDataSource2 = oForm.DataSources.DBDataSources.Add ("@VALUE0");
oEditText.DataBind.SetBound(true, "", "EditSource");
oEditText1.DataBind.SetBound(true, "@VALUE0", "U_cl");
so that in this code i have facing a error "Object Reference is not to sent of object"
Hi Pankaj,
can you please debug the code and tell me in which line exactly it is giving the error.
oEditText = ((SAPbouiCOM.EditText)(oItem.Specific));
in this line you gave Oitem.specific
and also there are two edit text objects( oEditText and oEditText1) make sure that both are pointed to some item in Form
Make sure that you assigned Oitem to Control on the form (oItem=Oform.Items.Item("URITEMUID").
and still you get the error make sure that in your database there is a table called @VALUE0,which contains a column with the name U_cl
ELSE YOU COPY THIS CODE
oItem=oForm.Items.Item("URITEMUID1")
oEditText = ((SAPbouiCOM.EditText)(oItem.Specific));
oItem=oForm.Items.Item("URITEMUID2")
oEditText1 = ((SAPbouiCOM.EditText)(oItem.Specific));
// bind the text edit item to the defined used data source
oDBDataSource2 = oForm.DataSources.DBDataSources.Add ("@VALUE0");
oForm.DataSources.UserDataSources.Add("EditSource", dt_SHORT_TEXT, 10)
oEditText.DataBind.SetBound(true, "", "EditSource");
oEditText1.DataBind.SetBound(true, "@VALUE0", "U_cl");
Hope this helps you
regards
Vishnu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Pankaj, did you point oEditText1 to an object? Your code here doesn't include that. That's probably it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pankaj,
This line may be causing you the problem
oEditText.DataBind.SetBound(true, "", "EditSource");
Comment the above line,only one datasource is enough to bind to a control (either dbdatasource or userdatasource)
OR
Have you added a user datasoure with name EditSource Else
add this line and then try
oForm.DataSources.UserDataSources.Add("EditSource", dt_SHORT_TEXT, 10)
Hope this helps
regards
Vishnu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.