Hi All,
I'm in the process of build a small mobile application (applogies if this post is the wrong area)
When binding a textbox to a table in the dataset i get a
This is strange as i can bind the dataset to a datagrid or a combobox with no problem.
Does anyone know if there is a limitation in the compact framework that doesnt allow this?
The code for this is
Many Thanks
James
I'm in the process of build a small mobile application (applogies if this post is the wrong area)
When binding a textbox to a table in the dataset i get a
Code:
"System Argument Exception: Argument Exception"
Does anyone know if there is a limitation in the compact framework that doesnt allow this?
The code for this is
Code:
Try
Dim StrMsg As String
StrMsg = "Add New Estimate for :" & ComboBox1.Text
Dim response As MsgBoxResult
response = MsgBox(StrMsg, MsgBoxStyle.YesNo)
If response = MsgBoxResult.No Then
'MsgBox("Add New Customer")
' create the dataadapter, and add to the dataset
Dim strSelectCustomers As String = "SELECT CustId, CustSName, CustFName, CustPhone1, CustPhone2, CustFax, CustMemo FROM TblCustTable"
Dim strConnString As String = "data source=192.168.1.200;database=Project;integrated security=SSPI;User ID=IUSR_PAUL-56F7AB7IHO;Password=password"
' Using the connection object
Dim connProject As New SqlClient.SqlConnection
connProject.ConnectionString = strConnString
'Dim cmdCustomers As New SqlCommand(strSelectCustomers, connProject)
Dim daAddCustomer As SqlDataAdapter
'Dim workTable As DataTable = New DataTable("TblCustTable")
connProject.Open()
daAddCustomer = New SqlDataAdapter(strSelectCustomers, connProject)
Dim StrState As String
daAddCustomer.Fill(dsCustomers, "TblCustTable")
' bind the controls to test the dataset
With ComboBox1
.DataSource = dsCustomers.Tables("TblCustTable")
.DisplayMember = "CustFName"
.ValueMember = "CustId"
End With
TxtCustFName.DataBindings.Add(New Binding("Text", dsCustomers, "TblCustTable.CustFName"))
TxtCustSName.DataBindings.Add(New Binding("Text", dsCustomers, "TblCustTable.CustSName"))
TxtCustPhone1.DataBindings.Add(New Binding("Text", dsCustomers, "TblCustTable.CustPhone1"))
TxtCustPhone2.DataBindings.Add(New Binding("Text", dsCustomers, "TblCustTable.CustPhone2"))
TxtCustFax.DataBindings.Add(New Binding("Text", dsCustomers, "TblCustTable.CustFax"))
TxtMemo.DataBindings.Add(New Binding("Text", dsCustomers, "TblCustTable.CustMemo"))
connProject.Close()
'show the controls
showControls()
' add new record
BindingContext(dsCustomers, "TblCustTable").AddNew()
Else
MsgBox("Take Combo Value and add new estimate")
End If
Catch excNull As Exception
MsgBox("3: " & excNull.GetBaseException.ToString())
'Console.WriteLine(excNull.InnerException)
Many Thanks
James