-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: ArunKSabat
Message 1 in Discussion
For Example
I have a User Class and a Address Class
The Address Class is
class Address
{ private int _AddressID;
private string _Address1;
private string _Address2;
private string _City;
private int _Zip;
private int _StateId;
private int _CountryID;
//Public accessors
public int AddressID
{
get { return _AddressID; }
set { _AddressID = value; }
}
public string Address1
{
get { return _Address1; }
set { _Address1 = value; }
}
public string Address2
{
get { return _Address2; }
set { _Address2 = value; }
}
public string City
{
get { return _City; }
set { _City = value; }
}
public int Zip
{
get { return _Zip; }
set { _Zip = value; }
}
public int StateID
{
get { return _StateId; }
set { _StateId = value; }
}
public int CountryID
{
get { return _CountryID; }
set { _CountryID = value; }
}
}
//User Class
class User
{
private int _UserID;
private string _firstName;
private string _lastname;
private string _email;
private string _Phone;
private Address _UserAddress; //Object of Address
class
private Address _UserDeptAddres
public int UserID
{
get { return _UserID; }
set { _UserID = value; }
}
public string FirstName
{
get { return _firstName; }
set { _firstName = value; }
}
public string lastname
{
get { return _lastname; }
set { _lastname = value; }
}
public string email
{
get { return _email; }
set { _email = value; }
}
public AddressInfo QCOAddress
{
get { return _QCOAddress; }
set { _QCOAddress = value; }
}
public AddressInfo DeptAddress
{
get { return _DeptAddress; }
set { _DeptAddress = value; }
}
}
And in My Bussness Class i am inserting And Updating records
class USERBO
{
public void insertDetails(user objUser)
{
//Calls DB to fill the Details from objUser
}
public void UpdateDetails(user objUser)
{
//Calls DB to update the Details from objUse
}
public user SelectDetails(int Userid)
{
//get the Deatils and return a object type
}
}
In UI i have a Form view and a object DataSource
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
TypeName="USERBO" DataObjectTypeName="user" InsertMethod="insertDetails">
</asp:ObjectDataSource>
And for Editing
<asp:ObjectDataSource ID="ObjectDataSource2" runat="server"
TypeName="USERBO" DataObjectTypeName="user" UpdateMethod="UpdateDetails"
SelectMethod="SelectDetails">
<SelectParameters>
<asp:Parameter DefaultValue="16" Name="userid" Type="int16"
/>
</SelectParameters>
</asp:ObjectDataSource>
Thru form view i selected "ObjectDataSource1" for insert mode
And Another form view selected "ObjectDataSource1" for edit mode.
In edit mode i used "Eval("UserAddress.Address1")" to bind Address1
text box.
By this it is retriving the values
But when i press update button the Addess values will be "null".
This may be because of Eval is One way databinding
So i feel i need to use BIND methiod
So i used Bind("UserAddress.Address1") to bind Address1 text
box.
But by this method i could not able to compile the page . Which shows
"Bind method is not in a proper Arguments"
Can u plz help me in this senario, such that the two Address objects
in User class can will filled.
And which is the same senario in Insert mode also.
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you
received this message by mistake, please click the "Remove" link below. On the
pre-addressed e-mail message that opens, simply click "Send". Your e-mail
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]