Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Editing a Record
Message
De
18/03/2005 00:48:03
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Titre:
Editing a Record
Divers
Thread ID:
00997113
Message ID:
00997113
Vues:
47
Hi Amigos!

I am trying to update a record with the following code:

Dim UsersUpdateCmd As New SqlClient.SqlCommand
UsersUpdateCmd.Connection = cn
UsersUpdateCmd.CommandType = CommandType.StoredProcedure
UsersUpdateCmd.CommandText = "UpdateUser"

UsersUpdateCmd.Parameters.Add("@UserID", SqlDbType.VarChar, 10, "UserID")
UsersUpdateCmd.Parameters.Add("@UserName", SqlDbType.VarChar, 20, "UserName")
UsersUpdateCmd.Parameters.Add("@Password", SqlDbType.VarChar, 20, "Password")

daUsers.UpdateCommand = UsersUpdateCmd

Dim EditRow As Data.DataRow = dtUsers.Rows(dtUsers.Rows.Count - 1)

EditRow.BeginEdit()

When any of the following lines are executed, I get an error message saying that they are ReadOnly.

EditRow("UserID") = "005"
EditRow("UserName") = "Odie"
EditRow("Password") = "456"

Any ideas as to why this is so? I've been at this since yesterday. Please HELP!!!

By the way, I have similar routines for adding and deleting records and I do not have any problems. It is only when I try to modify a record that I encounter problems.

Desparately yours,

Martin
Shit happens!!!
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform