Cannot create a child list for field property
-
Hello all, Two part question: A. What am I doing wrong with the code below to generate the error on the Subject line above? B. Is binding the best option (such as the one I have below) of displaying a specific record on a form? ////////////////////// Private sqlConn As SqlConnection Private SqlDataAdapter1 As SqlDataAdapter Private sqlCmd As SqlCommand Private DataSet11 As DataSet Private Sub frmPropertyDetailTest_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim pintProperty As Short Dim pbndtemp As Binding sqlConn = New SqlConnection("Server=server;Database=db;User ID=us;Password=pw;Trusted_Connection=False") sqlCmd = New SqlCommand sqlCmd.Connection = sqlConn sqlCmd.CommandType = CommandType.Text sqlCmd.CommandText = "SELECT dbo.property.* FROM dbo.property" sqlConn.Open() SqlDataAdapter1 = New SqlDataAdapter SqlDataAdapter1.SelectCommand = sqlCmd DataSet11 = New DataSet pintProperty = Me.SqlDataAdapter1.Fill(DataSet11) pbndtemp = New Binding("Text", DataSet11, "property.PropertyID") Me.txtPropertyID.DataBindings.Add(pbndtemp) pbndtemp = New Binding("Text", DataSet11, "property.PropertyName") Me.txtPropertyName.DataBindings.Add(pbndtemp) pbndtemp = New Binding("Text", DataSet11, "property.Address1") Me.txtAddress1.DataBindings.Add(pbndtemp) pbndtemp = New Binding("Text", DataSet11, "property.Address2") Me.txtAddress2.DataBindings.Add(pbndtemp) pbndtemp = New Binding("Text", DataSet11, "property.City") Me.txtCity.DataBindings.Add(pbndtemp) pbndtemp = New Binding("Text", DataSet11, "property.State") Me.txtState.DataBindings.Add(pbndtemp) pbndtemp = New Binding("Text", DataSet11, "property.Postal") Me.txtZip.DataBindings.Add(pbndtemp) pbndtemp = New Binding("Text", DataSet11, "property.Country") Me.txtCountry.DataBindings.Add(pbndtemp) pbndtemp = New Binding("Text", DataSet11, "property.Business") Me.txtBusinessNumber.DataBindings.Add(pbndtemp) pbndtemp = New Binding("Text", DataSet11, "property.Fax") Me.txtFaxNumber.DataBindings.Add(pbndtemp) pbndtemp = New Binding("Text", DataSet11, "property.Support") Me.txtSupportNumber.DataBindings.Add(pbndtemp) pbndtemp = New Binding("Text", DataSet11, "proper
-
Hello all, Two part question: A. What am I doing wrong with the code below to generate the error on the Subject line above? B. Is binding the best option (such as the one I have below) of displaying a specific record on a form? ////////////////////// Private sqlConn As SqlConnection Private SqlDataAdapter1 As SqlDataAdapter Private sqlCmd As SqlCommand Private DataSet11 As DataSet Private Sub frmPropertyDetailTest_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim pintProperty As Short Dim pbndtemp As Binding sqlConn = New SqlConnection("Server=server;Database=db;User ID=us;Password=pw;Trusted_Connection=False") sqlCmd = New SqlCommand sqlCmd.Connection = sqlConn sqlCmd.CommandType = CommandType.Text sqlCmd.CommandText = "SELECT dbo.property.* FROM dbo.property" sqlConn.Open() SqlDataAdapter1 = New SqlDataAdapter SqlDataAdapter1.SelectCommand = sqlCmd DataSet11 = New DataSet pintProperty = Me.SqlDataAdapter1.Fill(DataSet11) pbndtemp = New Binding("Text", DataSet11, "property.PropertyID") Me.txtPropertyID.DataBindings.Add(pbndtemp) pbndtemp = New Binding("Text", DataSet11, "property.PropertyName") Me.txtPropertyName.DataBindings.Add(pbndtemp) pbndtemp = New Binding("Text", DataSet11, "property.Address1") Me.txtAddress1.DataBindings.Add(pbndtemp) pbndtemp = New Binding("Text", DataSet11, "property.Address2") Me.txtAddress2.DataBindings.Add(pbndtemp) pbndtemp = New Binding("Text", DataSet11, "property.City") Me.txtCity.DataBindings.Add(pbndtemp) pbndtemp = New Binding("Text", DataSet11, "property.State") Me.txtState.DataBindings.Add(pbndtemp) pbndtemp = New Binding("Text", DataSet11, "property.Postal") Me.txtZip.DataBindings.Add(pbndtemp) pbndtemp = New Binding("Text", DataSet11, "property.Country") Me.txtCountry.DataBindings.Add(pbndtemp) pbndtemp = New Binding("Text", DataSet11, "property.Business") Me.txtBusinessNumber.DataBindings.Add(pbndtemp) pbndtemp = New Binding("Text", DataSet11, "property.Fax") Me.txtFaxNumber.DataBindings.Add(pbndtemp) pbndtemp = New Binding("Text", DataSet11, "property.Support") Me.txtSupportNumber.DataBindings.Add(pbndtemp) pbndtemp = New Binding("Text", DataSet11, "proper
Hello Try to use the property in DataMember Property Use with ur Database Name,(i.e) Dbo , In ur Fill statement the table name comes with DB name check the table mappings property Ishak
-
Hello Try to use the property in DataMember Property Use with ur Database Name,(i.e) Dbo , In ur Fill statement the table name comes with DB name check the table mappings property Ishak