newbie: How do i update the datagrid?

G

Guest

I have the following code to get data into the datagrid.
Try
sql_vac = "SELECT subject.sub_name AS [Subject Name],
vacancy.vac_no_edu AS [No Educator Number], " & _
"vacancy.vac_no_qualified AS [Educator not Suitably
Qualified], vacancy.vac_gr1 AS [Grade 1], vacancy.vac_gr2 AS [Grade 2], " & _
"vacancy.vac_gr3 AS [Grade 3], vacancy.vac_gr4 AS
[Grade 4], vacancy.vac_gr5 AS [Grade 5], vacancy.vac_gr7 AS [Grade 6], " & _
"vacancy.vac_gr6 AS [Grade 7], vacancy.vac_gr8 AS
[Grade 8], vacancy.vac_gr9 AS [Grade 9], vacancy.vac_gr10 AS [Grade 10], " & _
"vacancy.vac_gr11 AS [Grade 11], vacancy.vac_gr12 AS
[Grade 12]" & _
"FROM subject RIGHT JOIN vacancy ON subject.sub_id =
vacancy.sub_id WHERE vacancy.survey_id ='" & surveyID & "'"
data_vac = ExecuteDataset(ConnString, CommandType.Text, sql_vac)
dgVacancy.DataSource = data_vac
dgVacancy.NavigateTo(0, "vacancy")
dgVacancy.Expand(0)

Catch ex As Exception
MessageBox.Show("data not loading in the datagrid : " &
ex.Message)
End Try

i have aet the readonly property to false...but i dont know how to update
the information (pdate/insert/delete queries)

Any pointers would help!
 
C

Cor Ligthert[MVP]

Losst,

Maybe you think your question is clear, however in my opinion it is not. The
word update is used to do that in many things. What do you want to update?

The datatable
The database
The datagrid

Cor
 
T

Tikeur

I think ( as i understood) that you want to update your database but
also the view. SO first your data is in a datatable, update your
datatable, after let's update your data in the database with the new
one in the datatble, and refresh the datagrid.
 
C

Cor Ligthert[MVP]

Are you using version 2005, have then a look at the gridview, the web
datagrid is very complex to use (for us and the enduser).

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top