Click here to Skip to main content
15,902,636 members
Home / Discussions / Web Development
   

Web Development

 
QuestionI want to Execuate EXE file on client machine through vbscript or javascript. Pin
divyesh143226-Feb-07 23:31
divyesh143226-Feb-07 23:31 
AnswerRe: I want to Execuate EXE file on client machine through vbscript or javascript. Pin
Bradml26-Feb-07 23:44
Bradml26-Feb-07 23:44 
AnswerRe: I want to Execuate EXE file on client machine through vbscript or javascript. Pin
User 171649226-Feb-07 23:54
professionalUser 171649226-Feb-07 23:54 
QuestionDatagrid fails to show data! Pin
nclauder26-Feb-07 22:04
nclauder26-Feb-07 22:04 
AnswerRe: Datagrid fails to show data! Pin
Marcus J. Smith27-Feb-07 3:11
professionalMarcus J. Smith27-Feb-07 3:11 
GeneralRe: Datagrid fails to show data! Pin
nclauder28-Feb-07 0:32
nclauder28-Feb-07 0:32 
GeneralRe: Datagrid fails to show data! Pin
Marcus J. Smith28-Feb-07 6:52
professionalMarcus J. Smith28-Feb-07 6:52 
GeneralRe: Datagrid fails to show data! Pin
nclauder28-Feb-07 20:17
nclauder28-Feb-07 20:17 
Thanks cleako,
This has solved the problem of one row multiplying into two. But I still press a button and it does not return a new column. I've writen the code for insert but still no change?

DataTable table = new DataTable();
private DataTable Fill()
{
SqlDataAdapter adapter = new SqlDataAdapter("select * from dbo.DashBoard", con);
adapter.Fill(table);
return table;
}

private void Bind()
{
dgis.DataSource = table;
dgis.DataBind();
}

private void InsertEmpty()
{
table.Rows.InsertAt(table.NewRow(), 0);
}

private void bttnew_Click(object sender, System.EventArgs e)
{
// inserting
dgis.EditItemIndex = 0;

// modify text
EditCommandColumn ecc = (EditCommandColumn) dgis.Columns[6];
ecc.UpdateText = "Insert";

// fill table, insert empty row, bind to datagrid
Fill();
InsertEmpty();
Bind();
}
private void dgis_ItemCommand(object source,System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
// stop editing
dgis.EditItemIndex = -1;

switch (e.CommandName)
{
case "Insert":
System.Web.UI.WebControls.TextBox st=new System.Web.UI.WebControls.TextBox();
st=(System.Web.UI.WebControls.TextBox)e.Item.Cells[5].FindControl("txtobjach");
System.Web.UI.WebControls.TextBox st1=new System.Web.UI.WebControls.TextBox();
st1=(System.Web.UI.WebControls.TextBox)e.Item.Cells[4].FindControl("txtobj");
System.Web.UI.WebControls.TextBox st2=new System.Web.UI.WebControls.TextBox();
st2=(System.Web.UI.WebControls.TextBox)e.Item.Cells[3].Controls[0];
System.Web.UI.WebControls.TextBox st3=new System.Web.UI.WebControls.TextBox();
st3=(System.Web.UI.WebControls.TextBox)e.Item.Cells[2].Controls[0];
System.Web.UI.WebControls.TextBox st4=new System.Web.UI.WebControls.TextBox();
st4=(System.Web.UI.WebControls.TextBox)e.Item.Cells[1].Controls[0];
System.Web.UI.WebControls.TextBox st5=new System.Web.UI.WebControls.TextBox();
st5=(System.Web.UI.WebControls.TextBox)e.Item.Cells[0].Controls[0];
SqlCommand myCommand=new SqlCommand();
myCommand.Connection=con;
myCommand.CommandText="insert into DashBoard (ObjectiveAchieved,Objective) values ('@ObjectiveAchieved' ,'@objective');";
myCommand.Parameters.Add(new SqlParameter("@ObjectiveAchieved",SqlDbType.Char,45));
myCommand.Parameters["@ObjectiveAchieved"].Value=st.Text;
myCommand.Parameters.Add(new SqlParameter("@Objective",SqlDbType.Char,45));
myCommand.Parameters["@Objective"].Value=st1.Text;
myCommand.Parameters.Add(new SqlParameter("@Workinghrs",SqlDbType.Char,45));
myCommand.Parameters["@Workinghrs"].Value=st2.Text;
myCommand.Parameters.Add(new SqlParameter("@Loggedout",SqlDbType.Char,45));
myCommand.Parameters["@Loggedout"].Value=st3.Text;
myCommand.Parameters.Add(new SqlParameter("@Loggedin",SqlDbType.Char,45));
myCommand.Parameters["@Loggedin"].Value=st4.Text;
myCommand.Parameters.Add(new SqlParameter("@MoodToday",SqlDbType.Char,45));
myCommand.Parameters["@MoodToday"].Value=st5.Text;
con.Open();
myCommand.ExecuteNonQuery();
con.Close();
dgis.EditItemIndex=-1;
BindDataGrid();
break;

case "Update":
break;

case "Cancel":
break;

case "Edit":
// begin editing
EditCommandColumn ecc = (EditCommandColumn) dgis.Columns[6];
ecc.UpdateText = "Insert";
dgis.EditItemIndex = e.Item.ItemIndex;
break;
}

// fill and bind
Fill();
Bind();
}

Thanks.
Questionapache server Pin
Manjunath S26-Feb-07 21:51
Manjunath S26-Feb-07 21:51 
AnswerRe: apache server Pin
Bradml26-Feb-07 23:44
Bradml26-Feb-07 23:44 
Questionnew error Pin
No-e26-Feb-07 9:17
No-e26-Feb-07 9:17 
AnswerRe: new error Pin
kubben26-Feb-07 9:27
kubben26-Feb-07 9:27 
GeneralRe: new error Pin
No-e26-Feb-07 9:47
No-e26-Feb-07 9:47 
QuestionHow to handle secondary tables that key off primary table Pin
MaxRelaxman26-Feb-07 7:23
MaxRelaxman26-Feb-07 7:23 
QuestionSpecified Cast Not Valid Pin
No-e26-Feb-07 7:12
No-e26-Feb-07 7:12 
AnswerRe: Specified Cast Not Valid Pin
kubben26-Feb-07 7:36
kubben26-Feb-07 7:36 
GeneralRe: Specified Cast Not Valid Pin
No-e26-Feb-07 9:01
No-e26-Feb-07 9:01 
GeneralRe: Specified Cast Not Valid Pin
kubben26-Feb-07 9:02
kubben26-Feb-07 9:02 
AnswerRe: Specified Cast Not Valid Pin
Guffa26-Feb-07 23:45
Guffa26-Feb-07 23:45 
Questionadding a row on a datagrid Pin
nclauder26-Feb-07 1:02
nclauder26-Feb-07 1:02 
QuestionSharepoint 2007 code to get a list of User Profiles. Pin
Member 368588925-Feb-07 23:41
Member 368588925-Feb-07 23:41 
QuestionASP 3.0 Search In Word Document using classic asp 3.0 Pin
adnanrafiq25-Feb-07 12:33
adnanrafiq25-Feb-07 12:33 
QuestionAuto-incrementing assembly build numbers for ASP.NET 2.0 Pin
MayyMagdy25-Feb-07 10:46
MayyMagdy25-Feb-07 10:46 
AnswerRe: Auto-incrementing assembly build numbers for ASP.NET 2.0 Pin
kubben26-Feb-07 7:41
kubben26-Feb-07 7:41 
GeneralWeb Development [modified] Pin
swjam24-Feb-07 20:42
swjam24-Feb-07 20:42 

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.