Click here to Skip to main content
15,912,665 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Calendar Control Pin
aaraaayen12-Dec-06 1:48
aaraaayen12-Dec-06 1:48 
QuestionHow to add a checkbox in a datagrid using datagrid Pin
sivaraman_ms12-Dec-06 0:05
sivaraman_ms12-Dec-06 0:05 
AnswerRe: How to add a checkbox in a datagrid using datagrid Pin
Imran Khan Pathan12-Dec-06 0:56
Imran Khan Pathan12-Dec-06 0:56 
AnswerRe: How to add a checkbox in a datagrid using datagrid Pin
postmaster@programmingknowledge.com12-Dec-06 16:17
postmaster@programmingknowledge.com12-Dec-06 16:17 
QuestionDeployment of Asp.net 2.0 Application. Pin
Kamal.Afridi11-Dec-06 23:59
Kamal.Afridi11-Dec-06 23:59 
AnswerRe: Deployment of Asp.net 2.0 Application. Pin
karam chandrabose12-Dec-06 0:42
karam chandrabose12-Dec-06 0:42 
GeneralRe: Deployment of Asp.net 2.0 Application. [modified] Pin
Kamal.Afridi12-Dec-06 1:03
Kamal.Afridi12-Dec-06 1:03 
QuestionDataSet bulk update problem Pin
Dinuraj11-Dec-06 23:28
Dinuraj11-Dec-06 23:28 
Hi,

I am developing a web appication using asp.net with c#.
I am updating Dataset using datgrid EditItemTemplate and storing in cache.
finally i want to update my table using SqlAdaptor Update mathod but i am gatting error.Please help me..

This is my Dataset Update mathod:
public void grdEmployee_Update(Object o,DataGridCommandEventArgs e)
{
int id = (int)grdEmployee.DataKeys[e.Item.ItemIndex];
TextBox txtName,txtDesignation,txtSex,txtAge,txtSalary;
txtName =(TextBox)e.Item.Cells[0].Controls[0];
txtDesignation =(TextBox)e.Item.Cells[1].Controls[0];
txtSex =(TextBox)e.Item.Cells[2].Controls[0];
txtAge =(TextBox)e.Item.Cells[3].Controls[0];
txtSalary =(TextBox)e.Item.Cells[4].Controls[0];
if (Cache["EMPCACHE"]!=null)
{
DataSet dsUpdate= (DataSet)Cache["EMPCACHE"];
dsUpdate.Tables[0].Rows[e.Item.ItemIndex]["NAME"]=txtName.Text;
dsUpdate.Tables[0].Rows[e.Item.ItemIndex]["DESIGNATION"]=txtDesignation.Text;
dsUpdate.Tables[0].Rows[e.Item.ItemIndex]["SEX"]=txtSex.Text;
dsUpdate.Tables[0].Rows[e.Item.ItemIndex]["AGE"]=Convert.ToInt32(txtAge.Text);
dsUpdate.Tables[0].Rows[e.Item.ItemIndex]["SALARY"]=Convert.ToSingle(txtSalary.Text);
dsUpdate.AcceptChanges();
Cache["EMPCACHE"]=dsUpdate;
grdEmployee.EditItemIndex = -1 ;
grdEmployee.DataSource = dsUpdate;
grdEmployee.DataBind();
}}

Finally i am going to update on Database using this code
private void btnDatabaseUpdate_Click(object sender, System.EventArgs e)
{
try
{
string strConnection= System.Configuration.ConfigurationSettings.AppSettings.Get("ConnectionString");
SqlConnection con = new SqlConnection();
con.ConnectionString = strConnection;
SqlDataAdapter sda = new SqlDataAdapter("select ID,NAME,DESIGNATION,SEX,AGE,SALARY from EMPLOYEEDETAILS",con);
SqlCommandBuilder scb = new SqlCommandBuilder(sda);
sda.Fill(dsObj,"EMPLOYEEDETAILS");
DataSet dsUpdate = (DataSet)Cache["EMPCACHE"];
dsObj = dsUpdate.Copy();
int success=sda.Update(dsObj,"EMPLOYEEDETAILS");
dsObj.AcceptChanges();
grdEmployee.DataSource = dsObj;
grdEmployee.DataBind();
}
catch (Exception ex)
{
Response.Write("
" + ex.Message.ToString());
}
}

I am gatting this error:
Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information.



waiting for promp reply

QuestionValidation Controls in ASP.Net Pin
kulile11-Dec-06 23:25
kulile11-Dec-06 23:25 
QuestionAsp Tree with "Intelligent Sorting" Pin
bazpaul11-Dec-06 23:09
bazpaul11-Dec-06 23:09 
AnswerRe: Asp Tree with "Intelligent Sorting" Pin
bazpaul12-Dec-06 4:18
bazpaul12-Dec-06 4:18 
GeneralRe: Asp Tree with "Intelligent Sorting" Pin
bazpaul13-Dec-06 22:24
bazpaul13-Dec-06 22:24 
QuestionASP.NET 2.0 Menu Control Pin
rico cheah11-Dec-06 21:13
rico cheah11-Dec-06 21:13 
QuestionPaging in dynamic built DataGrid control Pin
Samah Helal11-Dec-06 20:48
Samah Helal11-Dec-06 20:48 
QuestionHelp Pin
Hari Prasad S.M11-Dec-06 20:47
Hari Prasad S.M11-Dec-06 20:47 
AnswerRe: Help Pin
karam chandrabose12-Dec-06 0:44
karam chandrabose12-Dec-06 0:44 
QuestionCreate Crystal Report at Runtime by ReportDocument Class Pin
Mahdi.Jabbari11-Dec-06 20:36
Mahdi.Jabbari11-Dec-06 20:36 
Questionhow can i use Bin folder at my asp.net application... Pin
vijayDaivam11-Dec-06 20:23
vijayDaivam11-Dec-06 20:23 
Questioncookies in asp.net Pin
Ravi Shankar4311-Dec-06 20:12
Ravi Shankar4311-Dec-06 20:12 
AnswerRe: cookies in asp.net Pin
Guffa11-Dec-06 20:16
Guffa11-Dec-06 20:16 
AnswerRe: cookies in asp.net Pin
Britney S. Morales12-Dec-06 9:35
Britney S. Morales12-Dec-06 9:35 
Questioncreateuserwizard problem Pin
jabbarsb11-Dec-06 19:49
jabbarsb11-Dec-06 19:49 
QuestionListBox and TextBox Pin
Preeti Mathur11-Dec-06 19:49
Preeti Mathur11-Dec-06 19:49 
AnswerRe: ListBox and TextBox Pin
Parwej Ahamad11-Dec-06 22:20
professionalParwej Ahamad11-Dec-06 22:20 
QuestionInserting data based on multi select list [modified] Pin
mohd imran abdul aziz11-Dec-06 19:46
mohd imran abdul aziz11-Dec-06 19:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.