Click here to Skip to main content
15,921,351 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Useing button within Repeater Pin
Shahdat Hosain8-Sep-09 21:51
Shahdat Hosain8-Sep-09 21:51 
GeneralRe: Useing button within Repeater Pin
Abhijit Jana8-Sep-09 20:31
professionalAbhijit Jana8-Sep-09 20:31 
AnswerRe: Useing button within Repeater Pin
Abhishek Sur8-Sep-09 22:12
professionalAbhishek Sur8-Sep-09 22:12 
QuestionHow to block the user from copying images from the website ? Pin
Subin Alex8-Sep-09 19:40
Subin Alex8-Sep-09 19:40 
AnswerRe: How to block the user from copying images from the website ? Pin
Christian Graus8-Sep-09 19:48
protectorChristian Graus8-Sep-09 19:48 
AnswerRe: How to block the user from copying images from the website ? Pin
sashidhar8-Sep-09 19:52
sashidhar8-Sep-09 19:52 
AnswerRe: How to block the user from copying images from the website ? Pin
Blikkies8-Sep-09 20:11
professionalBlikkies8-Sep-09 20:11 
Questionupdate excel using oledb (is primary key possible) Pin
amittinku8-Sep-09 19:26
amittinku8-Sep-09 19:26 
Hi,
I bind the gridview to excel in disconnected mode. works fine.
MAke changes to gridview data. changes happen and reflected in dataset.
Try to update the dataset using adapter (to transfer the changes to same excel in connected mode). commandbuilder thorws exception as it is not able to find a primary key in excel sheet. How to do it?

public partial class excel_excel_disconnmode : System.Web.UI.Page
{
OleDbConnection oo;
OleDbDataAdapter adp;
DataSet ds;

protected void Page_Load(object sender, EventArgs e)
{
oo = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\\ASP1\\Book1.xlsx;Extended Properties=Excel 12.0");
adp = new OleDbDataAdapter("select ID from [Sheet1$]", oo);

if (!IsPostBack)
{
ds = new DataSet();
ViewState["ds"] = ds;
adp.Fill(ds, "sheet1");
GridView1.DataSource = ds;
GridView1.DataBind();
}
else
{
ds = (DataSet)ViewState["ds"];
GridView1.DataSource = ds;
}
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex; // turn to edit mode
GridView1.DataBind();
}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int pos = e.RowIndex;
ds.Tables[0].Rows[pos].Delete();
GridView1.DataBind();
}
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
int pos = e.RowIndex;
string name = ((TextBox)GridView1.Rows[pos].Cells[0].Controls[0]).Text;
ds.Tables[0].Rows[pos][0] = name;
GridView1.EditIndex = -1;
GridView1.DataBind();
}
protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
GridView1.EditIndex = -1;
GridView1.DataBind();
}
//to trasnfer the changes from disconnected to connected excel
protected void Button1_Click(object sender, EventArgs e)
{
adp = new OleDbDataAdapter("select ID from [Sheet1$]", oo);
OleDbCommandBuilder xx = new OleDbCommandBuilder(adp);
adp.Update(ds, "sheet1");

}
}
AnswerRe: update excel using oledb (is primary key possible) Pin
mylogics8-Sep-09 21:47
professionalmylogics8-Sep-09 21:47 
GeneralRe: update excel using oledb (is primary key possible) Pin
amittinku8-Sep-09 21:49
amittinku8-Sep-09 21:49 
QuestionAssembly = "DataGridCheckbox" Pin
mabsoott8-Sep-09 19:24
mabsoott8-Sep-09 19:24 
AnswerRe: Assembly = "DataGridCheckbox" Pin
Christian Graus8-Sep-09 19:46
protectorChristian Graus8-Sep-09 19:46 
QuestionProblem in showing Alert Box [Solved] Pin
nagendrathecoder8-Sep-09 19:15
nagendrathecoder8-Sep-09 19:15 
AnswerRe: Problem in showing Alert Box Pin
Christian Graus8-Sep-09 19:16
protectorChristian Graus8-Sep-09 19:16 
GeneralRe: Problem in showing Alert Box Pin
nagendrathecoder8-Sep-09 19:24
nagendrathecoder8-Sep-09 19:24 
GeneralRe: Problem in showing Alert Box Pin
Arun Jacob8-Sep-09 19:31
Arun Jacob8-Sep-09 19:31 
GeneralRe: Problem in showing Alert Box Pin
nagendrathecoder8-Sep-09 19:36
nagendrathecoder8-Sep-09 19:36 
GeneralRe: Problem in showing Alert Box Pin
yesu prakash8-Sep-09 19:40
yesu prakash8-Sep-09 19:40 
GeneralRe: Problem in showing Alert Box Pin
nagendrathecoder8-Sep-09 19:47
nagendrathecoder8-Sep-09 19:47 
GeneralRe: Problem in showing Alert Box Pin
Christian Graus8-Sep-09 19:50
protectorChristian Graus8-Sep-09 19:50 
GeneralRe: Problem in showing Alert Box Pin
Christian Graus8-Sep-09 19:42
protectorChristian Graus8-Sep-09 19:42 
GeneralRe: Problem in showing Alert Box Pin
nagendrathecoder8-Sep-09 19:54
nagendrathecoder8-Sep-09 19:54 
GeneralRe: Problem in showing Alert Box Pin
Christian Graus8-Sep-09 19:56
protectorChristian Graus8-Sep-09 19:56 
AnswerRe: Problem in showing Alert Box Pin
nagendrathecoder8-Sep-09 20:16
nagendrathecoder8-Sep-09 20:16 
GeneralRe: Problem in showing Alert Box Pin
nagendrathecoder8-Sep-09 20:40
nagendrathecoder8-Sep-09 20:40 

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.