Click here to Skip to main content
15,892,005 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: custom asp.net sql server shopping cart problem. Pin
VijayVishwakarma4-Sep-08 0:31
VijayVishwakarma4-Sep-08 0:31 
QuestionSetting up an enviroment for sharpoint 2007 Pin
TheEagle3-Sep-08 21:36
TheEagle3-Sep-08 21:36 
QuestionHandling Browser Close button Pin
K V Sekhar3-Sep-08 21:30
K V Sekhar3-Sep-08 21:30 
AnswerRe: Handling Browser Close button Pin
Abhijit Jana3-Sep-08 22:43
professionalAbhijit Jana3-Sep-08 22:43 
GeneralRe: Handling Browser Close button Pin
K V Sekhar3-Sep-08 23:03
K V Sekhar3-Sep-08 23:03 
GeneralRe: Handling Browser Close button Pin
K V Sekhar4-Sep-08 0:07
K V Sekhar4-Sep-08 0:07 
AnswerRe: Handling Browser Close button Pin
eyeseetee3-Sep-08 22:57
eyeseetee3-Sep-08 22:57 
Questiongridview rowupdating using parametrized query. Pin
wajans3-Sep-08 21:20
wajans3-Sep-08 21:20 
Hi
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.
Thanks
 protected void gv_RowUpdating1(object sender, GridViewUpdateEventArgs e)
    {
        connectAccessDb();
        int i = e.RowIndex;
        //par = cmd.Parameters;
        //cmd.Parameters.Clear();
        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;

        cmd.ExecuteNonQuery();
        cmd.ExecuteNonQuery();
        //gv.EditIndex = -1;
        cn.Close();
        bindData();

      
    }
 private void bindData()
    {    
        connectAccessDb();
        da = new OleDbDataAdapter("SELECT id,companyname,companyaddress,companycity  from companydetail order by companyname", cn);       
        da.Fill(ds, "companydetail");
        gv.DataSource = ds;
        gv.DataBind();
        cn.Close();        
    }
private void connectAccessDb()
    {

        cn = new OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=" + strRootDir + "App_Data\\newsdb.mdb");
        cn.Open();
    }

QuestionGrid view issue while editing Pin
trilokharry3-Sep-08 20:27
trilokharry3-Sep-08 20:27 
QuestionEmail domain verification code not working Pin
Learning IT3-Sep-08 20:23
Learning IT3-Sep-08 20:23 
AnswerRe: Email domain verification code not working Pin
Guffa3-Sep-08 20:45
Guffa3-Sep-08 20:45 
GeneralRe: Email domain verification code not working Pin
Learning IT3-Sep-08 21:31
Learning IT3-Sep-08 21:31 
QuestionAdding the Datatable values to GridView in .net 2005 Pin
Karan_TN3-Sep-08 20:19
Karan_TN3-Sep-08 20:19 
Questiondisplay Records details inside formview on linkbutton click (problem) Pin
Rameez Raja3-Sep-08 20:01
Rameez Raja3-Sep-08 20:01 
QuestionDownload three datagrid in one excel file Pin
Tarun Dudhatra3-Sep-08 19:19
Tarun Dudhatra3-Sep-08 19:19 
QuestionUsing Aspnet_regsql.exe Pin
ASPnoob3-Sep-08 17:26
ASPnoob3-Sep-08 17:26 
Question3.5 sp1 and vs 2008 sp1 Pin
ToddHileHoffer3-Sep-08 6:06
ToddHileHoffer3-Sep-08 6:06 
AnswerRe: 3.5 sp1 and vs 2008 sp1 Pin
ToddHileHoffer3-Sep-08 8:23
ToddHileHoffer3-Sep-08 8:23 
GeneralRe: 3.5 sp1 and vs 2008 sp1 Pin
N a v a n e e t h3-Sep-08 17:21
N a v a n e e t h3-Sep-08 17:21 
QuestionHTML CONTROL Pin
kibromg3-Sep-08 4:40
kibromg3-Sep-08 4:40 
AnswerRe: HTML CONTROL Pin
NeverHeardOfMe3-Sep-08 4:50
NeverHeardOfMe3-Sep-08 4:50 
AnswerRe: HTML CONTROL Pin
Pete O'Hanlon3-Sep-08 4:51
mvePete O'Hanlon3-Sep-08 4:51 
GeneralRe: HTML CONTROL Pin
kibromg3-Sep-08 5:07
kibromg3-Sep-08 5:07 
AnswerRe: HTML CONTROL Pin
Perspx3-Sep-08 6:03
Perspx3-Sep-08 6:03 
GeneralRe: HTML CONTROL [modified] Pin
NeverHeardOfMe3-Sep-08 5:55
NeverHeardOfMe3-Sep-08 5:55 

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.