如何在网格视图中更新我的数据 [英] How to update my data in grid view
问题描述
UPDATE语句与FOREIGN KEY约束FK__STANDARDS__S_ID__4AB81AF0冲突。冲突发生在数据库SAMPLE_1,表dbo.SCHOOL,列S_ID中。该语句已终止。
PLS更正如果错误,IAM新工作因此我可以学习它
< br $>
我的任务是
只是想更新SEND的S_NAME和S_NAME的ID应该在后面保存所有标准.ASPX
我尝试过:
这些我的代码
SCHOOL .ASPX
<%@ Page 语言 = C# AutoEventWireup = true CodeBehind = SCHOOL_1.aspx.cs 继承 = WebApplication1.SCHOOL_1 %>
< !DOCTYPE < span class =code-attribute> html PUBLIC - // W3C // DTD XHTML 1.0 Transitional // EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd >
< html xmlns = http://www.w3.org/1999/xhtml >
< head id = Head1 runat = 服务器 >
< title > < / title >
< / head >
< 正文 >
< 表格 id = form1 runat = server >
< div >
< asp:标签 ID = Label1 runat = server 文字 = 学校名称 < span class =code-keyword>>
< asp :TextBox ID = TextBox1 runat = server >
< br / >
< span class =code-keyword>< br / >
< br / > ;
< br / >
< ; asp:标签 ID = Label2 runat = 服务器 文字 = NO_OF_STANDARDS >
< asp:TextBox ID = TextBox2 runat = server >
< br / >
< br / >
< asp:按钮 ID < span class =code-keyword> = Button1 runat = server onclick = Button1_Click 文字 = 提交 / >
< br / >
< br / >
< br / >
< br / >
< br / >
< asp:GridView ID = GridView1 runat = server < span class =code-attribute>高度 = 190px
宽度 = 266px < span class =code-attribute>
< span class =code-attribute> DataSourceID = sql1 >
< asp:SqlDataSource ID = sql1 < span class =code-attribute> runat = server
ConnectionString = <% $ ConnectionStrings:ApplicationServices_1 %>
SelectCommand = SELECT S_ID,S_NAME,NO_OF_STANDARD FROM [SCHOOL] >
< < span class =code-leadattribute> br / >
< asp:按钮 ID = Button2 runat = 服务器 onclick = Button2_Click 文字 = 返回 / >
< < span class =code-leadattribute> br / >
< br / >
< / div >
< / form >
< / body >
< / html > ;
The UPDATE statement conflicted with the FOREIGN KEY constraint "FK__STANDARDS__S_ID__4AB81AF0". The conflict occurred in database "SAMPLE_1", table "dbo.SCHOOL", column 'S_ID'. The statement has been terminated. 这篇关于如何在网格视图中更新我的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
SCHOOL.ASPX.CS
< pre lang =HTML>使用System;
使用System.Collections.Generic;
使用System.Linq;
使用System.Web;
使用System.Web.UI;
使用System.Web.UI.WebControls;
使用System.Data;
使用System.Data.SqlClient;
命名空间WebApplication1
{
公共部分类SCHOOL_1:System.Web.UI.Page
{
protected void Page_Load(object sender,EventArgs e)
{
}
protected void Button1_Click(object sender,EventArgs e)
{
SqlConnection con = new SqlConnection(@Data Source = CSI60-PC\SQLEXPRESS; Initial Catalog = SAMPLE_1; Integrated Security = True);
SqlCommand cmd = new SqlCommand(插入学校值('+ TextBox1.Text +','+ TextBox2.Text +'),con);
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;
DataSet ds = new DataSet();
da.Fill(ds,school);
}
protected void Button2_Click(object sender,EventArgs e)
{
Response.Redirect(HOME_1.aspx);
}
}
}
STANDARDS.ASPX
<%@ Page 语言 = C# AutoEventWireup = true CodeBehind = STANDARD_1.aspx.cs 继承 = WebApplication1.STANDARDS_1 %>
< !DOCTYPE html PUBLIC - / / W3C // DTD XHTML 1.0 Transitional // EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd > 宽度 = 255px < span class =code-attribute> DataSourceID = sql2
< html xmlns = http://www.w3.org/1999/xhtml >
< head id = Head1 runat = 服务器 >
< title > < / title >
< span class =code-keyword>< / head >
< body >
< span class =code-keyword>< form id = form1 runat = server >
< div >
< asp:标签 ID = Label1 < span class =code-attribute> runat = 服务r 文字 = CLASS >
< asp:TextBox ID = TextBox1 < span class =code-attribute> runat = server >
< br / >
< br / >
< ; br / < span class =code-keyword>>
学校名称
< asp:DropDownList ID = DropDownList1 runat = server
< span class =code-attribute> DataSourceID = SqlDataSource1 DataTextField = S_NAME DataValueField = S_ID >
< asp:SqlDataSource ID = SqlDataSource1 runat = server
ConnectionString = <% $ ConnectionStrings:ApplicationServices_1 %>
SelectCommand = SELECT [S_ID],[S_NAME] FROM [SCHOOL] >
< br / >
< br / >
< asp:GridView ID = GridView1 runat = < span class =code-keyword> server 高度 = 214px
AutoGenerateColumns = false AutoGenerateEditButton =
< span class =code-attribute> AllowSorting = True AllowPaging = 真 < span class =code-attribute> DataKeyNames = STD_ID >
< 列 >
< asp:BoundField ReadOnly = True HeaderText = std_id
DataField = std_id SortExpression = std_id >
< asp:BoundField HeaderText = class DataField = class
SortExpression = class >
< asp:TemplateField HeaderText =
< edititemtemplate >
< asp:DropDownList ID = DropDownList2 runat=\"server\" DataSourceID=\"Sql3\"
</edititemtemplate>
<itemtemplate>
\t\t<asp:Label ID=\"Label1\" runat=\"server\" Text='<%# Bind(\"S_NAME\") %>'>
\t</itemtemplate>
</columns>
<asp:SqlDataSource ID=\"sql2\" runat=\"server\"
ConnectionString=\"<%$ ConnectionStrings:ApplicationServices_1 %>\"
SelectCommand=\"select STANDARDS.STD_ID,STANDARDS.CLASS,SCHOOL.S_NAME
from SCHOOL
left join STANDARDS
on STANDARDS.S_ID=SCHOOL.S_ID\"
UpdateCommand=\"update [STANDARDS] set [CLASS]=@CLASS,[S_ID]=@STD_ID where [STD_ID]=@STD_ID\">
<updateparameters>
<asp:Parameter Type=\"Int16\" Name=\"CLASS\" />
<asp:Parameter Type=\"Int16\" Name=\"S_ID\" />
</updateparameters>
<br />
<br />
<asp:Button ID=\"Button1\" runat=\"server\" onclick=\"Button1_Click\" Text=\"SUBMIT\" />
</div>
<asp:SqlDataSource ID=\"Sql3\" runat=\"server\"
ConnectionString=\"<%$ ConnectionStrings:ApplicationServices_1 %>\"
SelectCommand=\"SELECT [S_ID],[S_NAME] FROM [SCHOOL]\" >
<br />
<br />
<br />
<br />
<asp:Button ID=\"Button2\" runat=\"server\" onclick=\"Button2_Click\" Text=\"back\" />
</form>
</body>
</html>
STANDARDS.ASPX.CS
using System;
使用System.Collections.Generic;
使用System.Linq;
使用System.Web;
使用System.Web.UI;
使用System.Web.UI.WebControls;
使用System.Data;
使用System.Data.SqlClient;
namespace WebApplication1
{
public partial class STANDARDS_1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(@\"Data Source=CSI60-PC\SQLEXPRESS;Initial Catalog=SAMPLE_1;Integrated Security=True\");
SqlCommand cmd = new SqlCommand(\"insert into STANDARDS values( '\" + TextBox1.Text + \"' ,'\" + DropDownList1.SelectedValue + \"')\", con);
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;
DataSet ds = new DataSet();
da.Fill(ds, \"STANDARDS\");
}
protected void Button2_Click(object sender, EventArgs e)
{
Response.Redirect(\"HOME_1.aspx\");
}
}
}
SQL TABLE STRUCTURE
CREATE TABLE SCHOOL(
\t[S_ID] [int] IDENTITY (1000,1) NOT NULL PRIMARY KEY ,
\t[S_NAME] [varchar](255) NOT NULL,
\t[NO_OF_STANDARD] [int] NOT NULL,
)
CREATE TABLE STANDARDS( $b $b \t[STD_ID] [int] IDENTITY (100,1) NOT NULL PRIMARY KEY,
\t[CLASS] [int]NOT NULL,
\t[S_ID] [int] NOT NULL FOREIGN KEY REFERENCES SCHOOL(S_ID),
\t)ConnectionStrings:ApplicationServices_1 %>\"
SelectCommand=\"SELECT S_ID,S_NAME,NO_OF_STANDARD FROM [SCHOOL]\">
<br />
<asp:Button ID=\"Button2\" runat=\"server\" onclick=\"Button2_Click\" Text=\"Back\" />
<br />
<br />
</div>
</form>
</body>
</html>
SCHOOL.ASPX.CS
using System;
html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
使用System.Collections.Generic;
使用System.Linq;
使用System.Web;
使用System.Web.UI;
使用System.Web.UI.WebControls;
使用System.Data;
使用System.Data.SqlClient;
namespace WebApplication1
{
public partial class SCHOOL_1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(@\"Data Source=CSI60-PC\SQLEXPRESS;Initial Catalog=SAMPLE_1;Integrated Security=True\");
SqlCommand cmd = new SqlCommand(\"insert into school values( '\" + TextBox1.Text + \"' ,'\" + TextBox2.Text + \"')\", con);
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;
DataSet ds = new DataSet();
da.Fill(ds, \"school\");
}
protected void Button2_Click(object sender, EventArgs e)
{
Response.Redirect(\"HOME_1.aspx\");
}
}
}
STANDARDS.ASPX
<%@ Page Language=\"C#\" AutoEventWireup=\"true\" CodeBehind=\"STANDARDS_1.aspx.cs\" Inherits=\"WebApplication1.STANDARDS_1\" %>
<!DOCTYPE
<html xmlns=\"http://www.w3.org/1999/xhtml\">
<head id=\"Head1\" runat=\"server\">
<title></title>
</head>
<body>
< span class=\"code-keyword\"><form id=\"form1\" runat=\"server\">
<div>
<asp:Label ID=\"Label1\" runat=\"serve r\" Text=\"CLASS\">
<asp:TextBox ID=\"TextBox1\" runat=\"server\">
<br />
<br />
<br />
SCHOOL NAME
<asp:DropDownList ID=\"DropDownList1\" runat=\"server\"
DataSourceID=\"SqlDataSource1\" DataTextField=\"S_NAME\" DataValueField=\"S_ID\">
<asp:SqlDataSource ID=\"SqlDataSource1\" runat=\"server\"
ConnectionString=\"<%ConnectionStrings:ApplicationServices_1 %>\"
SelectCommand=\"SELECT [S_ID], [S_NAME] FROM [SCHOOL]\">
<br />
<br />
<asp:GridView ID=\"GridView1\" runat=\"server\" Height=\"214px\" Width=\"255px\" DataSourceID=\"sql2\"
AutoGenerateColumns=\"false\" AutoGenerateEditButton=\"true\"
AllowSorting=\"True\" AllowPaging=\"True\" DataKeyNames=\"STD_ID\" >
<columns>
<asp:BoundField ReadOnly=\"True\" HeaderText=\"std_id\"
\t\tDataField=\"std_id\" SortExpression=\"std_id\">
\t\t<asp:BoundField HeaderText=\"class\" DataField=\"class\"
\t\tSortExpression=\"class\">
\t<asp:TemplateField HeaderText=\"S_NAME\" SortExpression=\"S_ID\">
<edititemtemplate>
<asp:DropDownList ID=\"DropDownList2\" runat=\"server\" DataSourceID=\"Sql3\" DataTextField=\"S_NAME\" DataValueField=\"S_ID\">
</edititemtemplate>
<itemtemplate>
\t\t<asp:Label ID=\"Label1\" runat=\"server\" Text='<%# Bind(\"S_NAME\") %>'>
\t</itemtemplate>
</columns>
<asp:SqlDataSource ID=\"sql2\" runat=\"server\"
ConnectionString=\"<%ConnectionStrings:ApplicationServices_1 %>\"
SelectCommand=\"select STANDARDS.STD_ID,STANDARDS.CLASS,SCHOOL.S_NAME
from SCHOOL
left join STANDARDS
on STANDARDS.S_ID=SCHOOL.S_ID\"
UpdateCommand=\"update [STANDARDS] set [CLASS]=@CLASS,[S_ID]=@STD_ID where [STD_ID]=@STD_ID\">
<updateparameters>
<asp:Parameter Type=\"Int16\" Name=\"CLASS\" />
<asp:Parameter Type=\"Int16\" Name=\"S_ID\" />
</updateparameters>
<br />
<br />
<asp:Button ID=\"Button1\" runat=\"server\" onclick=\"
</div>
<asp:SqlDataSource ID=\"Sql3\" runat=\"server\"
ConnectionString=\"<%
PLS CORRECT IT IF AM WRONG ,IAM NEW TO WORK SO THAT I CAN LEARN IT
MY TASK IS
JUST WANT TO UPDATE THE S_NAME IN FRONTEND AND THE ID OF THE S_NAME SHOULD BE THE SAVED IN BACKEND ALL IN STANDARDS.ASPX
What I have tried:
THESE AR MY CODE
SCHOOL.ASPX
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCHOOL_1.aspx.cs" Inherits="WebApplication1.SCHOOL_1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="SCHOOL NAME">
<asp:TextBox ID="TextBox1" runat="server">
<br />
<br />
<br />
<br />
<asp:Label ID="Label2" runat="server" Text="NO_OF_STANDARDS">
<asp:TextBox ID="TextBox2" runat="server">
<br />
<br />
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="SUBMIT" />
<br />
<br />
<br />
<br />
<br />
<asp:GridView ID="GridView1" runat="server" Height="190px"
Width="266px"
DataSourceID="sql1">
<asp:SqlDataSource ID="sql1" runat="server"
ConnectionString="<%$ ConnectionStrings:ApplicationServices_1 %>"
SelectCommand="SELECT S_ID,S_NAME,NO_OF_STANDARD FROM [SCHOOL]">
<br />
<asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="Back" />
<br />
<br />
</div>
</form>
</body>
</html>
SCHOOL.ASPX.CS
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
namespace WebApplication1
{
public partial class SCHOOL_1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(@"Data Source=CSI60-PC\SQLEXPRESS;Initial Catalog=SAMPLE_1;Integrated Security=True");
SqlCommand cmd = new SqlCommand("insert into school values( '" + TextBox1.Text + "' ,'" + TextBox2.Text + "')", con);
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;
DataSet ds = new DataSet();
da.Fill(ds, "school");
}
protected void Button2_Click(object sender, EventArgs e)
{
Response.Redirect("HOME_1.aspx");
}
}
}
STANDARDS.ASPX
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="STANDARDS_1.aspx.cs" Inherits="WebApplication1.STANDARDS_1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="CLASS">
<asp:TextBox ID="TextBox1" runat="server">
<br />
<br />
<br />
SCHOOL NAME
<asp:DropDownList ID="DropDownList1" runat="server"
DataSourceID="SqlDataSource1" DataTextField="S_NAME" DataValueField="S_ID">
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ApplicationServices_1 %>"
SelectCommand="SELECT [S_ID], [S_NAME] FROM [SCHOOL]">
<br />
<br />
<asp:GridView ID="GridView1" runat="server" Height="214px" Width="255px" DataSourceID="sql2"
AutoGenerateColumns="false" AutoGenerateEditButton="true"
AllowSorting="True" AllowPaging="True" DataKeyNames="STD_ID" >
<columns>
<asp:BoundField ReadOnly="True" HeaderText="std_id"
DataField="std_id" SortExpression="std_id">
<asp:BoundField HeaderText="class" DataField="class"
SortExpression="class">
<asp:TemplateField HeaderText="S_NAME" SortExpression="S_ID">
<edititemtemplate>
<asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="Sql3" DataTextField="S_NAME" DataValueField="S_ID">
</edititemtemplate>
<itemtemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("S_NAME") %>'>
</itemtemplate>
</columns>
<asp:SqlDataSource ID="sql2" runat="server"
ConnectionString="<%$ ConnectionStrings:ApplicationServices_1 %>"
SelectCommand="select STANDARDS.STD_ID,STANDARDS.CLASS,SCHOOL.S_NAME
from SCHOOL
left join STANDARDS
on STANDARDS.S_ID=SCHOOL.S_ID"
UpdateCommand="update [STANDARDS] set [CLASS]=@CLASS,[S_ID]=@STD_ID where [STD_ID]=@STD_ID">
<updateparameters>
<asp:Parameter Type="Int16" Name="CLASS" />
<asp:Parameter Type="Int16" Name="S_ID" />
</updateparameters>
<br />
<br />
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="SUBMIT" />
</div>
<asp:SqlDataSource ID="Sql3" runat="server"
ConnectionString="<%$ ConnectionStrings:ApplicationServices_1 %>"
SelectCommand="SELECT [S_ID],[S_NAME] FROM [SCHOOL]" >
<br />
<br />
<br />
<br />
<asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="back" />
</form>
</body>
</html>
STANDARDS.ASPX.CS
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
namespace WebApplication1
{
public partial class STANDARDS_1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(@"Data Source=CSI60-PC\SQLEXPRESS;Initial Catalog=SAMPLE_1;Integrated Security=True");
SqlCommand cmd = new SqlCommand("insert into STANDARDS values( '" + TextBox1.Text + "' ,'" + DropDownList1.SelectedValue + "')", con);
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;
DataSet ds = new DataSet();
da.Fill(ds, "STANDARDS");
}
protected void Button2_Click(object sender, EventArgs e)
{
Response.Redirect("HOME_1.aspx");
}
}
}
SQL TABLE STRUCTURE
CREATE TABLE SCHOOL(
[S_ID] [int] IDENTITY (1000,1) NOT NULL PRIMARY KEY ,
[S_NAME] [varchar](255) NOT NULL,
[NO_OF_STANDARD] [int] NOT NULL,
)
CREATE TABLE STANDARDS(
[STD_ID] [int] IDENTITY (100,1) NOT NULL PRIMARY KEY,
[CLASS] [int]NOT NULL,
[S_ID] [int] NOT NULL FOREIGN KEY REFERENCES SCHOOL(S_ID),
)
ConnectionStrings:ApplicationServices_1 %>"
SelectCommand="SELECT S_ID,S_NAME,NO_OF_STANDARD FROM [SCHOOL]">
<br />
<asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="Back" />
<br />
<br />
</div>
</form>
</body>
</html>
SCHOOL.ASPX.CS
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
namespace WebApplication1
{
public partial class SCHOOL_1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(@"Data Source=CSI60-PC\SQLEXPRESS;Initial Catalog=SAMPLE_1;Integrated Security=True");
SqlCommand cmd = new SqlCommand("insert into school values( '" + TextBox1.Text + "' ,'" + TextBox2.Text + "')", con);
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;
DataSet ds = new DataSet();
da.Fill(ds, "school");
}
protected void Button2_Click(object sender, EventArgs e)
{
Response.Redirect("HOME_1.aspx");
}
}
}
STANDARDS.ASPX
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="STANDARDS_1.aspx.cs" Inherits="WebApplication1.STANDARDS_1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="CLASS">
<asp:TextBox ID="TextBox1" runat="server">
<br />
<br />
<br />
SCHOOL NAME
<asp:DropDownList ID="DropDownList1" runat="server"
DataSourceID="SqlDataSource1" DataTextField="S_NAME" DataValueField="S_ID">
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%
ConnectionStrings:ApplicationServices_1 %>"
SelectCommand="SELECT [S_ID], [S_NAME] FROM [SCHOOL]">
<br />
<br />
<asp:GridView ID="GridView1" runat="server" Height="214px" Width="255px" DataSourceID="sql2"
AutoGenerateColumns="false" AutoGenerateEditButton="true"
AllowSorting="True" AllowPaging="True" DataKeyNames="STD_ID" >
<columns>
<asp:BoundField ReadOnly="True" HeaderText="std_id"
DataField="std_id" SortExpression="std_id">
<asp:BoundField HeaderText="class" DataField="class"
SortExpression="class">
<asp:TemplateField HeaderText="S_NAME" SortExpression="S_ID">
<edititemtemplate>
<asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="Sql3" DataTextField="S_NAME" DataValueField="S_ID">
</edititemtemplate>
<itemtemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("S_NAME") %>'>
</itemtemplate>
</columns>
<asp:SqlDataSource ID="sql2" runat="server"
ConnectionString="<%
ConnectionStrings:ApplicationServices_1 %>"
SelectCommand="select STANDARDS.STD_ID,STANDARDS.CLASS,SCHOOL.S_NAME
from SCHOOL
left join STANDARDS
on STANDARDS.S_ID=SCHOOL.S_ID"
UpdateCommand="update [STANDARDS] set [CLASS]=@CLASS,[S_ID]=@STD_ID where [STD_ID]=@STD_ID">
<updateparameters>
<asp:Parameter Type="Int16" Name="CLASS" />
<asp:Parameter Type="Int16" Name="S_ID" />
</updateparameters>
<br />
<br />
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="SUBMIT" />
</div>
<asp:SqlDataSource ID="Sql3" runat="server"
ConnectionString="<%