へのアップデートは、私は、エラーがあるこの単純な挿入、SQL Serverの
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
protected void Add_Click(object sender, EventArgs e)
{
string strConnectionString = ConfigurationManager.ConnectionStrings["SqlServerCstr"].ConnectionString;
SqlConnection myConnection = new SqlConnection(strConnectionString);
string musteriadi = DropDownList1.SelectedIndex.ToString();
string avukat = DropDownList2.SelectedIndex.ToString();
string query = @"UPDATE AVUKAT SET MUSTERİ = @musteriadi, AVUKAT = avukat";
SqlCommand myCommand = new SqlCommand();
myCommand.Connection = myConnection;
myConnection.Open();
GridView1.DataSource = myCommand.ExecuteReader();
GridView1.DataBind();
GridView1.Visible = true;
myConnection.Close();
}
のような単純なコードがありますか?単純に、AVUKATテーブルに2つの列を追加したいのですが、
どうすれば解決できますか?
エラーは何ですか? –
実際に私は知らない:( –
あなたがエラーSonerであるかどうかを調べるために試してみる必要がある –