Now, i want to put a Update button in the form so that when the user modifies the data in the textboxes and radio buttons
and then clicks on the button,the updated data is sent back to the required row in the teamemtable.How is it done?
i've given you sample code for this
jack007
2.Plus can i put add and delete button next to two drop down list .so that i can add and delete data to 2 dropdownlist
and 2 tables teamtable and teamemtable during RUN time.
You have to have editable DDL for this(any third party controls or user control). But in this example i used normal controls only.
Team code add option
an extra text box for new team code with add and delete button. while adding a new team code in runtime i made a empty string check in team code textbox. you have to give your teamname and teamcode as comma separted string.
Team Code del option
When you click del button a javascript confirm message will be displayed for confirmation and delete the team code along the with members of teammemtable.
Mem Code add option
In this option the memcode will be generated automatically and take the values of name,age and gender from name,age and gender controls respectively. Here i dont do any validations
Hope you got what i'm trying to explain.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="t-1208420.aspx.cs" Inherits="DropDownList_t_1208420" %>
<!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 runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID ="ScripManager1" runat ="server"></asp:ScriptManager>
<div>
<asp:UpdatePanel ID ="udpnlTmCde" runat ="server" UpdateMode ="conditional">
<ContentTemplate>
<div>
<asp:DropDownList ID ="ddl1" runat ="server" OnSelectedIndexChanged="ddl1_SelectedIndexChanged" AutoPostBack ="true">
</asp:DropDownList>
</div>
<div style="z-index: 100; left: 75px; position: absolute; top: 15px">
<asp:Button ID ="btnDelTmCde" runat ="server" Text ="DelTeam" OnClick="btnDelTmCde_Click" CausesValidation ="false"/>
<asp:TextBox ID ="txtBxNwTmCde" runat ="server" ToolTip ="Enter the teamName and TeamCode (TeamA,1)" ></asp:TextBox>
<asp:Button ID ="btnAddTmCde" runat ="Server" Text ="AddTeam" OnClick="btnAddTmCde_Click" />
<asp:RequiredFieldValidator ID ="vldrTmCode" runat ="server" ControlToValidate ="txtBxNwTmCde" Display ="dynamic" ErrorMessage ="Enter the team name with team code (TeamA,1)" SetFocusOnError ="true"></asp:RequiredFieldValidator>
<ajaxToolkit:ConfirmButtonExtender ID ="ExtnrDelCode" runat ="server" TargetControlID ="btnDelTmCde" ConfirmText ="Do you want to delete this team code along with all team members?" >
</ajaxToolkit:ConfirmButtonExtender>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div>
<asp:UpdatePanel runat ="server" ID="UpdPnl" UpdateMode ="conditional">
<ContentTemplate>
<table>
<tr>
<td>
<asp:DropDownList ID ="ddl2" runat ="server" OnSelectedIndexChanged="ddl2_SelectedIndexChanged" AutoPostBack ="true"></asp:DropDownList>
</td>
<td>
<asp:RadioButton ID ="rdoBtnMale" runat ="server" GroupName ="Gender" Text ="Male" />
<asp:RadioButton ID ="rdoBtnFeMale" runat ="server" GroupName ="Gender" Text ="Female" />
</td>
</tr>
<tr>
<td>
<asp:TextBox ID ="txtName" runat ="server"></asp:TextBox>
</td>
<td>
<asp:TextBox ID ="txtAge" runat ="server"></asp:TextBox>
</td>
</tr>
<tr>
<td align ="center">
<asp:Button ID="btnUpdate" runat ="server" Text ="Update" OnClick="btnUpdate_Click" CausesValidation ="false" />
<asp:Button ID ="btnAddMem" runat ="server" Text ="Add" OnClick="btnAddMem_Click" CausesValidation ="false"/>
<asp:Button ID ="btnDelMem" runat ="server" Text ="Del" OnClick="btnDelMem_Click" CausesValidation ="false"/>
</td>
</tr>
</table>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID ="ddl1" EventName ="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
</div>
</div>
</form>
</body>
</html>
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class DropDownList_t_1208420 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
AssignDDLDataSource();
ddl1_SelectedIndexChanged(null, null);
}
}
private void AssignDDLDataSource()
{
SqlConnection con = CreateConnection();
if (con.State != ConnectionState.Open)
con.Open();
string sqlQry = "SELECT TEAMNAME DISPMEM, TEAMCODE VALMEM FROM TEAMTABLE";
SqlCommand cmd = new SqlCommand(sqlQry,con);
ddl1.DataSource = cmd.ExecuteReader();
ddl1.DataTextField = "DISPMEM";
ddl1.DataValueField = "VALMEM";
ddl1.DataBind();
}
private SqlConnection CreateConnection()
{
SqlConnection con = new SqlConnection("Data Source=10.100.1.66;Initial Catalog=mirage;Persist Security Info=True;User ID=mirage;Password=mirage");
return con;
}
private void AssignTextBoxValues(string teamval,string memval)
{
SqlConnection con = CreateConnection();
if (con.State != ConnectionState.Open)
con.Open();
//AssignSubjectDDL(val);string sqlQry = "Select MEMNAME,MEMAGE,MEMGNDR from TEAMMEMTABLE where TEAMCODE = '" + teamval +"' AND MEMCODE = '" + memval + "'";
SqlCommand cmd = new SqlCommand(sqlQry, con);
SqlDataReader rdr = cmd.ExecuteReader();
while (rdr.Read())
{
txtName.Text = rdr["MEMNAME"].ToString().Trim();
txtAge.Text = rdr["MEMAGE"].ToString().Trim();
if (rdr["MEMGNDR"].ToString().Trim() == "M")
{
rdoBtnMale.Checked = true;
rdoBtnFeMale.Checked = false;
}
else if (rdr["MEMGNDR"].ToString().Trim() == "F")
{
rdoBtnMale.Checked = false;
rdoBtnFeMale.Checked = true;
}
else
{
rdoBtnMale.Checked = false;
rdoBtnFeMale.Checked = false;
}
}
}
private void AssignSubjectDDL(string val)
{
SqlConnection con = CreateConnection();
if (con.State != ConnectionState.Open)
con.Open();
string sqlQry = "SELECT MEMNAME DISPMEM, MEMCODE VALMEM FROM TEAMMEMTABLE where TEAMCODE = '" + val + "'";
SqlCommand cmd1 = new SqlCommand(sqlQry, con);
ddl2.DataSource = cmd1.ExecuteReader();
ddl2.DataTextField = "DISPMEM";
ddl2.DataValueField = "VALMEM";
ddl2.DataBind();
ddl2_SelectedIndexChanged(null, null);
}
protected void ddl1_SelectedIndexChanged(object sender, EventArgs e)
{
AssignSubjectDDL(ddl1.SelectedValue);
}
protected void ddl2_SelectedIndexChanged(object sender, EventArgs e)
{
ClearControls();
AssignTextBoxValues(ddl1.SelectedValue,ddl2.SelectedValue);
}
protected void btnUpdate_Click(object sender, EventArgs e)
{
SqlConnection con = CreateConnection();
if (con.State != ConnectionState.Open)
con.Open();
string sqlQry = "UPDATE TEAMMEMTABLE" +
" SET MEMNAME = @MEMNAME," +
" MEMAGE = @MEMAGE," +
" MEMGNDR = @MEMGNDR" +
" WHERE MEMCODE = @MEMCODE" +
" AND TEAMCODE = @TEAMCODE";
SqlCommand cmd1 = new SqlCommand(sqlQry, con);
cmd1.Parameters.Add(new SqlParameter("@MEMNAME", txtName.Text.Trim()));
cmd1.Parameters.Add(new SqlParameter("@MEMAGE", txtAge.Text.Trim()));
cmd1.Parameters.Add(new SqlParameter("@MEMGNDR", (rdoBtnMale.Checked)? "M" :(rdoBtnFeMale.Checked) ? "F" : ""));
cmd1.Parameters.Add(new SqlParameter("@MEMCODE", ddl2.SelectedValue.Trim()));
cmd1.Parameters.Add(new SqlParameter("@TEAMCODE", ddl1.SelectedValue.Trim()));
cmd1.ExecuteNonQuery();
AssignDDLDataSource();
ddl1_SelectedIndexChanged(null, null);
}
protected void btnAddTmCde_Click(object sender, EventArgs e)
{
SqlConnection con = CreateConnection();
if (con.State != ConnectionState.Open)
con.Open();
string sqlQry = "INSERT INTO TEAMTABLE" +
" VALUES (@TEAMCODE,@TEAMNAME)";
string [] values = txtBxNwTmCde.Text.Split(new char [] {','});
SqlCommand cmd1 = new SqlCommand(sqlQry, con);
cmd1.Parameters.Add(new SqlParameter("@TEAMCODE", values[1] ));
cmd1.Parameters.Add(new SqlParameter("@TEAMNAME", values[0]));
cmd1.ExecuteNonQuery();
AssignDDLDataSource();
ddl1_SelectedIndexChanged(null, null);
}
protected void btnDelTmCde_Click(object sender, EventArgs e)
{
SqlConnection con = CreateConnection();
if (con.State != ConnectionState.Open)
con.Open();
string sqlQry = "DELETE TEAMTABLE" +
" WHERE TEAMCODE = @TEAMCODE";
SqlCommand cmd1 = new SqlCommand(sqlQry, con);
cmd1.Parameters.Add(new SqlParameter("@TEAMCODE", ddl1.SelectedValue.Trim()));
cmd1.ExecuteNonQuery();
string sqlQry1 = "DELETE TEAMMEMTABLE" +
" WHERE TEAMCODE = @TEAMCODE";
SqlCommand cmd = new SqlCommand(sqlQry1, con);
cmd.Parameters.Add(new SqlParameter("@TEAMCODE", ddl1.SelectedValue.Trim()));
cmd.ExecuteNonQuery();
AssignDDLDataSource();
ddl1_SelectedIndexChanged(null, null);
UpdPnl.Update();
}
protected void btnAddMem_Click(object sender, EventArgs e)
{
SqlConnection con = CreateConnection();
if (con.State != ConnectionState.Open)
con.Open();
string sqlQry1 = "SELECT ISNULL(MAX(MEMCODE),0) + 1 FROM TEAMMEMTABLE " +
" WHERE TEAMCODE = @TEAMCODE";
SqlCommand cmd = new SqlCommand(sqlQry1, con);
cmd.Parameters.Add(new SqlParameter("@TEAMCODE", ddl1.SelectedValue.Trim()));
string memcode = "";
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
memcode = dr[0].ToString().Trim();
}
dr.Close();
string sqlQry = "INSERT INTO TEAMMEMTABLE" +
" VALUES (@TEAMCODE,@MEMCODE,@MEMNAME,@MEMAGE,@MEMGNDR)";
SqlCommand cmd1 = new SqlCommand(sqlQry, con);
cmd1.Parameters.Add(new SqlParameter("@TEAMCODE", ddl1.SelectedValue.Trim()));
cmd1.Parameters.Add(new SqlParameter("@MEMCODE", memcode));
cmd1.Parameters.Add(new SqlParameter("@MEMNAME", txtName.Text.Trim()));
cmd1.Parameters.Add(new SqlParameter("@MEMAGE", txtAge.Text.Trim()));
cmd1.Parameters.Add(new SqlParameter("@MEMGNDR", (rdoBtnMale.Checked) ? "M" : (rdoBtnFeMale.Checked) ? "F" : ""));
cmd1.ExecuteNonQuery();
AssignDDLDataSource();
ddl1_SelectedIndexChanged(null, null);
udpnlTmCde.Update();
}
protected void btnDelMem_Click(object sender, EventArgs e)
{
SqlConnection con = CreateConnection();
if (con.State != ConnectionState.Open)
con.Open();
string sqlQry1 = "DELETE TEAMMEMTABLE" +
" WHERE MEMCODE = @MEMCODE";
SqlCommand cmd = new SqlCommand(sqlQry1, con);
cmd.Parameters.Add(new SqlParameter("@MEMCODE", ddl2.SelectedValue.Trim()));
cmd.ExecuteNonQuery();
AssignDDLDataSource();
ddl1_SelectedIndexChanged(null, null);
udpnlTmCde.Update();
}
private void ClearControls()
{
txtName.Text = "";
txtAge.Text = "";
}
}
HTH
With Luv
Dhana
Dont forget to mark as answer if my reply helped you...
Marked as answer by jack007 on Feb 15, 2008 09:43 AM
> 1. while adding data to teamtable and teamemtable, the duplication of data is also accepting.
any idea how to remove the duplication?
If have TSQL returning duplicate values, you can use DISTINCT to remove duplicate values as in:
SELECT DISTINCT A, B FROM FRED .........
Click "Mark as Answer" on the post that helped you.
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239
>1. while adding data to teamtable and teamemtable, the duplication of data is also accepting. any idea how to remove the duplication?
I suggest you the following construction in your insert stored procedures
IF NOT EXISTS(SELECT * FROM tablename WHERE .....)
INSERT INTO tablename(.....) VALUES (.....)
Click "Mark as Answer" on the post that helped you.
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239
>2. if i add 2 more textboxes in the same webform to get more user information(for email,phone) and i want to insert the data from these 2 textboxes into new table(say user_info) at the click of the add button at the end. for eg: i want to have it this
way:- table user_info(email,phone,teamemtable_id) Here teamemtable_id is the id of the current teamemtable row that is being selected in the same web
Instead of creating a new table, just extend the existing teamemtable.
Click "Mark as Answer" on the post that helped you.
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239
jack007
Member
165 Points
588 Posts
Re: filling the textbox,dropdownlist from the database??
Jan 30, 2008 05:42 AM|LINK
Hi Dhana,
The sample code u provided worked for me.Thanks.
Now i need some little modification here..
Hope u can help me out..
According to your example,
1.The first dropdownlist is populating from table teamtable and the second dropdownlist is populating from table teamemtable.
Plus two textboxes and radio buttons are automatically populating with the rest of the values from table teamemtable.
Its very fine till here.
Now, i want to put a Update button in the form so that when the user modifies the data in the textboxes and radio buttons
and then clicks on the button,the updated data is sent back to the required row in the teamemtable.How is it done?
2.Plus can i put add and delete button next to two drop down list .so that i can add and delete data to 2 dropdownlist
and 2 tables teamtable and teamemtable during RUN time.
Any thought for these?
Thanks..
Jack..[:)]
jack007
Member
165 Points
588 Posts
Re: filling the textbox,dropdownlist from the database??
Feb 03, 2008 09:26 AM|LINK
Hello Dhana,
Refering to my last question,
i could do the updation of the row in teamemtable by myself.
But i coulnot still get pass the second question.
see i am able to add teamcode and teamname column in teamtable table
during run time by clicking on add button.(here i put insert query in code behind).
but similarly i couldnot put data into teamemtable during runtime.
well i could but i dont know how to pass query here.
i m confused here.
insert into teamemtable(teamcode,memcode,memname,memage,memgndr) values( what should i give here? )
lets take ur example:
so if i want to insert new row in line no 10 like this( 1,4,'jack',25,'M') by writing code then how
can do this? lets say i put add button next to teamemtable.
so when i click on it during run time,i want 3 textboxes to appear in my
web form to enter 'jack',25,'M'.but at the same time the teamcode(1) and memcode(4)
should automatically filled into the new row.
i hope ur getting my point.i
tried to this but could not.may be u have a solution for this.
thanks.
jack..
dhanabalanr
Participant
978 Points
181 Posts
Re: filling the textbox,dropdownlist from the database??
Feb 04, 2008 10:11 AM|LINK
Hi Jack,
Sorry for the late reply
i've given you sample code for this
You have to have editable DDL for this(any third party controls or user control). But in this example i used normal controls only.
Team code add option
an extra text box for new team code with add and delete button. while adding a new team code in runtime i made a empty string check in team code textbox. you have to give your teamname and teamcode as comma separted string.
Team Code del option
When you click del button a javascript confirm message will be displayed for confirmation and delete the team code along the with members of teammemtable.
Mem Code add option
In this option the memcode will be generated automatically and take the values of name,age and gender from name,age and gender controls respectively. Here i dont do any validations
Hope you got what i'm trying to explain.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="t-1208420.aspx.cs" Inherits="DropDownList_t_1208420" %> <!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 runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID ="ScripManager1" runat ="server"></asp:ScriptManager> <div> <asp:UpdatePanel ID ="udpnlTmCde" runat ="server" UpdateMode ="conditional"> <ContentTemplate> <div> <asp:DropDownList ID ="ddl1" runat ="server" OnSelectedIndexChanged="ddl1_SelectedIndexChanged" AutoPostBack ="true"> </asp:DropDownList> </div> <div style="z-index: 100; left: 75px; position: absolute; top: 15px"> <asp:Button ID ="btnDelTmCde" runat ="server" Text ="DelTeam" OnClick="btnDelTmCde_Click" CausesValidation ="false"/> <asp:TextBox ID ="txtBxNwTmCde" runat ="server" ToolTip ="Enter the teamName and TeamCode (TeamA,1)" ></asp:TextBox> <asp:Button ID ="btnAddTmCde" runat ="Server" Text ="AddTeam" OnClick="btnAddTmCde_Click" /> <asp:RequiredFieldValidator ID ="vldrTmCode" runat ="server" ControlToValidate ="txtBxNwTmCde" Display ="dynamic" ErrorMessage ="Enter the team name with team code (TeamA,1)" SetFocusOnError ="true"></asp:RequiredFieldValidator> <ajaxToolkit:ConfirmButtonExtender ID ="ExtnrDelCode" runat ="server" TargetControlID ="btnDelTmCde" ConfirmText ="Do you want to delete this team code along with all team members?" > </ajaxToolkit:ConfirmButtonExtender> </div> </ContentTemplate> </asp:UpdatePanel> </div> <div> <asp:UpdatePanel runat ="server" ID="UpdPnl" UpdateMode ="conditional"> <ContentTemplate> <table> <tr> <td> <asp:DropDownList ID ="ddl2" runat ="server" OnSelectedIndexChanged="ddl2_SelectedIndexChanged" AutoPostBack ="true"></asp:DropDownList> </td> <td> <asp:RadioButton ID ="rdoBtnMale" runat ="server" GroupName ="Gender" Text ="Male" /> <asp:RadioButton ID ="rdoBtnFeMale" runat ="server" GroupName ="Gender" Text ="Female" /> </td> </tr> <tr> <td> <asp:TextBox ID ="txtName" runat ="server"></asp:TextBox> </td> <td> <asp:TextBox ID ="txtAge" runat ="server"></asp:TextBox> </td> </tr> <tr> <td align ="center"> <asp:Button ID="btnUpdate" runat ="server" Text ="Update" OnClick="btnUpdate_Click" CausesValidation ="false" /> <asp:Button ID ="btnAddMem" runat ="server" Text ="Add" OnClick="btnAddMem_Click" CausesValidation ="false"/> <asp:Button ID ="btnDelMem" runat ="server" Text ="Del" OnClick="btnDelMem_Click" CausesValidation ="false"/> </td> </tr> </table> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID ="ddl1" EventName ="SelectedIndexChanged" /> </Triggers> </asp:UpdatePanel> </div> </div> </form> </body> </html>HTH
Dhana
Dont forget to mark as answer if my reply helped you...
jack007
Member
165 Points
588 Posts
Re: filling the textbox,dropdownlist from the database??
Feb 07, 2008 05:33 AM|LINK
Hi dhanabalanr,
Sorry for Thanking you late.
The code u showed looks very simple and nice to understand.It worked for me.
But i have few questions here.
1. while adding data to teamtable and teamemtable, the duplication of data is also accepting.
any idea how to remove the duplication?
2. if i add 2 more textboxes in the same webform to get more user information(for email,phone)
and i want to insert the data from these 2 textboxes into new table(say user_info) at the click of the add button at the end.
for eg: i want to have it this way:-
table user_info(email,phone,teamemtable_id)
Here teamemtable_id is the id of the current teamemtable row that is being selected in the same web form using dropdownlist.
Finally, i want to show the data from all the three columns combined(teamtable,teamemtable,user_info) in either gridview or detailsview.
Well i tried to do it myself but couldnot complete it. hope u can help me out.
Anyway,Thanks.
Jack.[:)]
TATWORTH
All-Star
72415 Points
14017 Posts
MVP
Re: filling the textbox,dropdownlist from the database??
Feb 07, 2008 05:45 AM|LINK
> 1. while adding data to teamtable and teamemtable, the duplication of data is also accepting.
any idea how to remove the duplication?
If have TSQL returning duplicate values, you can use DISTINCT to remove duplicate values as in:
SELECT DISTINCT A, B FROM FRED .........
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239
jack007
Member
165 Points
588 Posts
Re: filling the textbox,dropdownlist from the database??
Feb 11, 2008 04:46 AM|LINK
Hello friend,
i have few questions here.
1. while adding data to teamtable and teamemtable, the duplication of data is also accepting. any idea how to remove the duplication?
2. if i add 2 more textboxes in the same webform to get more user information(for email,phone) and i want to insert the data from these 2
textboxes into new table(say user_info) at the click of the add button at the end. for eg: i want to have it this way:- table
user_info(email,phone,teamemtable_id) Here teamemtable_id is the id of the current teamemtable row that is being selected in the same web
form using dropdownlist.
Finally, i want to show the data from all the three columns combined(teamtable,teamemtable,user_info) in either gridview or detailsview.
any idea on how to overcome these issue?
thanks.
jack.
TATWORTH
All-Star
72415 Points
14017 Posts
MVP
Re: filling the textbox,dropdownlist from the database??
Feb 11, 2008 05:52 AM|LINK
>1. while adding data to teamtable and teamemtable, the duplication of data is also accepting. any idea how to remove the duplication?
I suggest you the following construction in your insert stored procedures
IF NOT EXISTS(SELECT * FROM tablename WHERE .....)
INSERT INTO tablename(.....) VALUES (.....)
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239
TATWORTH
All-Star
72415 Points
14017 Posts
MVP
Re: filling the textbox,dropdownlist from the database??
Feb 11, 2008 05:56 AM|LINK
>2. if i add 2 more textboxes in the same webform to get more user information(for email,phone) and i want to insert the data from these 2 textboxes into new table(say user_info) at the click of the add button at the end. for eg: i want to have it this way:- table user_info(email,phone,teamemtable_id) Here teamemtable_id is the id of the current teamemtable row that is being selected in the same web
Instead of creating a new table, just extend the existing teamemtable.
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239
jack007
Member
165 Points
588 Posts
Re: filling the textbox,dropdownlist from the database??
Feb 15, 2008 09:35 AM|LINK
HI dhanabalanr,
I could do most of the modification in my scenario but still i could not this one.may be u can help me out.
while adding data to teamtable and teamemtable, the duplication of data is also accepting.
any idea how to remove the duplication in both database and ddl?
thanks.
jack.
jack007
Member
165 Points
588 Posts
Re: filling the textbox,dropdownlist from the database??
Feb 15, 2008 09:58 AM|LINK
Hi TATWORTH,
well the code u showed is to select it only right.
but if i need to add a data to table(insert query).
and during insert i want no duplication of data getting inserted into the same column inside the table.
hope ur getting my point.
any clue?
thanks.
jack.