Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

Datagridview jumping the first column to add a row from textbox's

$
0
0

Hi

I have a table (Microsoft Access 2007) and i want to add rows (from textbox's) .

my table look like that with many column's 

Table.Columns.AddRange(New DataColumn() {New DataColumn("Nom", GetType(System.String)), New DataColumn("Prénom", GetType(System.String)), New DataColumn("naissance", GetType(System.String)), New DataColumn("Adresse", GetType(System.String)), New DataColumn("Tel", GetType(System.String)), New DataColumn("OD", GetType(System.String)), New DataColumn("OG", GetType(System.String)), New DataColumn("Dr", GetType(System.String)), New DataColumn("Consulté le", GetType(System.String)), New DataColumn("verres", GetType(System.String)), New DataColumn("Prix verres", GetType(System.String)), New DataColumn("Monture", GetType(System.String)), New DataColumn("Prix monture", GetType(System.String)), New DataColumn("Total", GetType(System.String)), New DataColumn("à payer", GetType(System.String))})


what i try to do is to jump the first column of Microsoft access (Number of Rows) . because i got many error related to that .

Me.Data1DataSet.Table1.Rows.Add((New Object() {Nom.Text, Prenom.Text, naissance.Text, Adresse.Text, Tel.Text, OD.Text, OG.Text, DR.Text, datedeconsul.Text, verre.Text, prixverre.Text, monture.Text, prixmonture.Text, total.Text, apayer.Text}))

and update my table and save 

Table1TableAdapter.Update(Me.Data1DataSet.Table1)


Error in debug says : "Rows cannot be programmatically added to the DataGridView's rows collection when the control is data-bound."

i need help to fix that please

if i have mistake in my ways to code , please correct me :-) 


Please i'm don't know if the error is related to my question , if you have a better idea , you're help will be appreciated :) 

Thinks



Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>