Click here to Skip to main content
15,879,490 members
Home / Discussions / Database
   

Database

 
QuestionInserting Images Pin
monrobot1327-Feb-06 22:08
monrobot1327-Feb-06 22:08 
AnswerRe: Inserting Images Pin
minkinin27-Feb-06 23:49
minkinin27-Feb-06 23:49 
Questionhelp with connecting to database server Pin
cpence2527-Feb-06 19:39
cpence2527-Feb-06 19:39 
AnswerRe: help with connecting to database server Pin
Mike Dimmick28-Feb-06 6:28
Mike Dimmick28-Feb-06 6:28 
GeneralRe: help with connecting to database server Pin
cpence2528-Feb-06 13:03
cpence2528-Feb-06 13:03 
QuestionHow to insert records into two tables using single Query Pin
Rajkamal_dfine27-Feb-06 18:53
Rajkamal_dfine27-Feb-06 18:53 
AnswerRe: How to insert records into two tables using single Query Pin
Andy Brummer27-Feb-06 19:02
sitebuilderAndy Brummer27-Feb-06 19:02 
Questionrow.Insert(x) isn't updating my table. Pin
3197527-Feb-06 10:56
3197527-Feb-06 10:56 
I am trying to edit an exisiting row in an existing table. I know I have the row as I can output to debug window values and column (field) names. When I then try and loop thru my rows and update a specific column, the code runs fine but the edits never get into my table/dataset.

Row.State returns "2".


The table is simply a SQLServre table I created with Enterprise Manager.
I am just trying to update some rows (ints and strings) from a sub in vb.Net.

either I am accessing the table in a read only manner or I am missing the function to make the "comit" happen. Any help would be appreciated.


If you need to look at the code, it is below...




Private Sub playwithSql()

Dim sqlConn As New SqlConnection(sConnection) <----This is cool...
Dim mysqlCommand As New SqlCommand

mysqlCommand.Connection = sqlConn
mysqlCommand.CommandType = CommandType.Text
mysqlCommand.CommandText = "SELECT * FROM TestTable"




Dim dsTxA As New DataSet

Dim dataAdapter As New SqlDataAdapter
dataAdapter.SelectCommand = mysqlCommand
dataAdapter.Fill(dsTxA)


Dim table As DataTable
table = dsTxA.Tables(0)

Dim col As DataColumn

For Each col In table.Columns
Debug.WriteLine(col.ColumnName)
Next col

Dim myrow As DataRow

For Each myrow In table.Rows

myrow.BeginEdit()
'' myrow.Item(2) = Date.Now
myrow.Item(1) = "data"

MessageBox.Show(myrow.RowState)

myrow.EndEdit()
'' myrow.AcceptChanges()

Next



''dataAdapter.Update(dsTVA)
''sqlConn.Close()

Debug.WriteLine("-----------------------------------------------------------")


End Sub

***DETAILS
sqlSrv2000
DotNet 1.1 (VB.NET)
AnswerRe: row.Insert(x) isn't updating my table. Pin
Ritesh123427-Feb-06 19:53
Ritesh123427-Feb-06 19:53 
AnswerRe: row.Insert(x) isn't updating my table. Pin
3197515-Mar-06 10:34
3197515-Mar-06 10:34 
QuestionExecute an SQL command with return value Pin
stephanm@cae.ca27-Feb-06 8:33
stephanm@cae.ca27-Feb-06 8:33 
QuestionSQL Server Comparing Dates Pin
Murthy India27-Feb-06 2:36
Murthy India27-Feb-06 2:36 
AnswerRe: SQL Server Comparing Dates Pin
J4amieC27-Feb-06 2:48
J4amieC27-Feb-06 2:48 
GeneralRe: SQL Server Comparing Dates Pin
Paul Conrad27-Feb-06 15:33
professionalPaul Conrad27-Feb-06 15:33 
GeneralRe: SQL Server Comparing Dates Pin
Murthy India27-Feb-06 18:19
Murthy India27-Feb-06 18:19 
QuestionDynamic Database Design Pin
Ingo27-Feb-06 0:20
Ingo27-Feb-06 0:20 
AnswerRe: Dynamic Database Design Pin
darkelv27-Feb-06 4:17
darkelv27-Feb-06 4:17 
GeneralRe: Dynamic Database Design Pin
Ingo27-Feb-06 21:20
Ingo27-Feb-06 21:20 
Questionnewbie: how to get started Pin
rnvrnv26-Feb-06 23:54
rnvrnv26-Feb-06 23:54 
AnswerRe: newbie: how to get started Pin
Paul Conrad27-Feb-06 15:42
professionalPaul Conrad27-Feb-06 15:42 
QuestionSQL Profiler trace and Performance Pin
devvvy26-Feb-06 14:56
devvvy26-Feb-06 14:56 
AnswerRe: SQL Profiler trace and Performance Pin
Andy Brummer27-Feb-06 18:50
sitebuilderAndy Brummer27-Feb-06 18:50 
QuestionSQL Server log - recycling Pin
devvvy26-Feb-06 14:42
devvvy26-Feb-06 14:42 
Questionoj Pin
dev dhoundiyal26-Feb-06 5:50
dev dhoundiyal26-Feb-06 5:50 
AnswerRe: oj Pin
Colin Angus Mackay26-Feb-06 6:29
Colin Angus Mackay26-Feb-06 6:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.