thanks for valuable suggestions.
I think I must create an web schedular that will constantly check for product expiry time and if they are still there after that I mean checkout is not done I must remove that items from that.
does this mean I must put the details of the product being added to a temp table and adding the expiry time in an row and creating a scheduler which will keep on checking this time and if its about to expire time then update the products table with these values again and remove the temp table data.
but in this I will be updating the expiry time of the cart each time the user adds a new item in its cart with in this expiry time. the new time will be again the max time of expiry. so i will have to maintain multiple values for a particular user as shopping cart can have multiple products.
Default.master.cs:(The below method is not executing when i closes the browser. I tried by placing break point)
protected void Main_Unload(object sender, EventArgs e)
str += "</script>";
DummyPage.aspx.cs(This is the page i am redirecting to user from javasript method)
if(Request.QueryString["msg"]!="") // I am trying to create a direcory for Checking purpose
DirecoryInfo dir = new DirecoryInfo(@"D:\Test");
if(dir.Exists == false)
It is quite difficult to control the back button in the browser.
The answers posted by me are suggestions only and cannot be used in anyway against me.
I have gridview and I am using gridview1_rowupdating event to update the gridview, but when I am using the code given below its not working. I do not know why it is not updating, it is not even showing error. please help me resolve this problem.
protected void gv_RowUpdating1(object sender, GridViewUpdateEventArgs e)
int i = e.RowIndex;
//par = cmd.Parameters;
string id = (gv.Rows[e.RowIndex].FindControl("lblCID") as Label).Text;
string comp = (gv.Rows[e.RowIndex].FindControl("txtCName") as TextBox).Text;
string address = (gv.Rows[e.RowIndex].FindControl("txtCAddr") as TextBox).Text;
string city = (gv.Rows[e.RowIndex].FindControl("txtCcity") as TextBox).Text;
//string strQuery="UPDATE companydetail SET companyname='" + comp + "',companyaddress='" + address + "',companycity='" + city + "' where id=" + Convert.ToInt32(id);
//dCmd = new OleDbCommand(strQuery, cn);
//dCmd = new OleDbCommand("UPDATE companydetail SET companyname=@comp, companyaddress=@address, companycity=@city where id=@id", cn);
string strQuery = "UPDATE companydetail SET companyname=@comp, companyaddress=@address, companycity=@city where id=@id";
cmd = new OleDbCommand(strQuery, cn);
cmd.Parameters.Add("@id", OleDbType.Integer).Value = Convert.ToInt32(id);
cmd.Parameters.Add("@comp", OleDbType.VarChar).Value = comp;
cmd.Parameters.Add("@address", OleDbType.VarChar).Value = address;
cmd.Parameters.Add("@city", OleDbType.VarChar).Value = city;
//gv.EditIndex = -1;
private void bindData()
da = new OleDbDataAdapter("SELECT id,companyname,companyaddress,companycity from companydetail order by companyname", cn);
gv.DataSource = ds;
private void connectAccessDb()
cn = new OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=" + strRootDir + "App_Data\\newsdb.mdb");
currently i m using asp.net with c# (2.0 framework).
here i created a datatable and put these values in gridview and i have displayed. But when i check the gridview row and column count, the row count is coming correctly. but the column count always remains 0. y? kindly help me... below i have attached the coding.........
sqlda=new System.Data.SqlClient.SqlDataAdapter("select tmp_values from tbl_table1", conn);
DTable = new DataTable("Headers");
DCol = new DataColumn("Head");
DRow = DTable.NewRow();
for (int i = 0; i <ds.Tables.Rows.Count; i++)
DCol = new DataColumn("" + ds.Tables.Rows[i].ToString() + "");
DCol = new DataColumn("" + ds.Tables.Rows[i].ToString() + " " + " Remarks");
GridView1.DataSource = DTable;
DTable.Columns.Count = 5 (its correct, but when bind with gridview and check the column count its zero)
GridView1.Rows.Count = 1 (its correct)
GridView1.Columns.Count = 0 (its incorrect, the answer should be 5)
iam facing problem how i display associated record details from database inside formview control
i have table control contains 32 cells in row and added linkbutton dynamicallly to table cells and added event handler as well but when iam clicking on all linkbuttons only one record is displying inside formview .
but i have to display associated record inside formview on linkbuton click.
I am working on a project and I am showing 4 different datagrid on the page. On the top of page there are 4 button for download, email, print and view full report. and also same option on the each indivisual grid. Our requirement is when user click on the individual button then it will download,print, email or full report will do respected task for perticular grid, but when user click on the top of the page then I want to give download all the four grid in one excel file, I want to send all the data as a email also same for print. I have done some thing for email and print but it't not too good if you have any example ready made then it will graceful. If you can give any suggesion then also it will be grace full.
Please help me it's very urgent
I am trying to execute Aspnet_regsql.exe by using VS 2005 Command Prompt but ran into a little problem.
The following command is what I wanted to use with a little modification. aspnet_regsql -E -S localhost -A all
I am trying to replace localhost with machinename\sqlserver instance. The problem I am having is I am uncertain if my machinename and sqlserver instance are supposed to be the same. I went into sql management studio and check registered servers and found that the name of my machine and the name of my sql instance are exactly the same. Is that supposed to be correct or is that wrong. If it is correct and if the name of my machine and the name of sql instance are Server1, can I replace localhost with Server1\Server1? If not what should the command be? Thank you in advance for your help.