--aşağıdaki kod bütün seçili rowlara işlem yapar
List SelectedUsers = grid.GetSelectedFieldValues(new string[] { "ID", "TUTAR" });
foreach (object user in SelectedUsers)
{
IList items = user as IList;
if (items == null) return;
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["CarringtonWebConnectionString1"].ConnectionString);
con.Open();
SqlCommand cmd = new SqlCommand("update ACIKHESAP set ODEME_DURUMU=1, ODENEN_TUTAR=" + items[1].ToString() + " where ID=" + items[0].ToString(), con);
cmd.ExecuteNonQuery();
}
---aşağıdaki kod seçili seçili deil farketmez hepsine işlem yapar
for (int i = 0; i < grid.VisibleRowCount; i++)
{
var items = grid.GetRowValues(i, new string[] { "ID", "TUTAR" }) as object[];
// ASPxListBox1.Items.Add(rowValues[0].ToString());
//you can add these key in a list here
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["CarringtonWebConnectionString1"].ConnectionString);
con.Open();
SqlCommand cmd = new SqlCommand("update ACIKHESAP set ODEME_DURUMU=2, ODENEN_TUTAR=" + items[1].ToString() + " where ID=" + items[0].ToString(), con);
cmd.ExecuteNonQuery();
Tag: .net
Github visual studio asp .net core projesi alip uyumlamak
git clone https://github.com/etrupja/DrinkAndGo.git
sonra projeyi aç appsettings.jsondan veritabanını deiş
Data Source=DESKTOP-PA213SA;Initial Catalog=dtest;Persist Security Info=True;User ID=sa;Password=2323211
view other window package manager consolea gir
ve aşağıya yazz önce
add-migration “Initial”
update-database