Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Editing problem in Datagrid

Editing problem in Datagrid

Scheduled Pinned Locked Moved C#
postgresqlcsharpasp-netdatabasesysadmin
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi, I've a datagrid connected to one table from postgres database. I'm using ODBC. Also, table has only 3 columns, out of which I'm using only 2 columns, and I'mve added these columns to datagrid manually. Now, when I try to edit ot even try to add new row after postback it doesnt seem to work! The form doesnt do anything. There is another form where I'm creating and populating (basically handling everything at runtime) and there the same piece of code is working just fine! Here is the code of the form that is not working... <--CODE-ASPX-START--> Make Changes Add New <--CODE-ASPX-END--> <--CODE-ASPX.CS-START--> private void Page_Load(object sender, System.EventArgs e) { string connectionStr = "DRIVER={PostgreSQL}; SERVER=localhost;UID=xxx;PASSWORD=xxx;Trusted_connection=false;DATABASE=marketing;"; string str = "select pk_url,url_name,url_comments FROM urls;"; connection = new OdbcConnection(connectionStr); connection.Open(); selectCommand = new OdbcCommand(str,connection); adapter = new OdbcDataAdapter(selectCommand); ds = new DataSet(); adapter.Fill(ds,"urls"); DataGrid1.DataSource = ds; DataGrid1.DataMember = "urls"; DataGrid1.DataBind(); connection.Close(); } #region Web Form Designer generated code override protected void OnInit(EventArgs e) { // // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent(); base.OnInit(e); } /// /// Required method for Designer support - do not modify

    X 1 Reply Last reply
    0
    • L Lost User

      Hi, I've a datagrid connected to one table from postgres database. I'm using ODBC. Also, table has only 3 columns, out of which I'm using only 2 columns, and I'mve added these columns to datagrid manually. Now, when I try to edit ot even try to add new row after postback it doesnt seem to work! The form doesnt do anything. There is another form where I'm creating and populating (basically handling everything at runtime) and there the same piece of code is working just fine! Here is the code of the form that is not working... <--CODE-ASPX-START--> Make Changes Add New <--CODE-ASPX-END--> <--CODE-ASPX.CS-START--> private void Page_Load(object sender, System.EventArgs e) { string connectionStr = "DRIVER={PostgreSQL}; SERVER=localhost;UID=xxx;PASSWORD=xxx;Trusted_connection=false;DATABASE=marketing;"; string str = "select pk_url,url_name,url_comments FROM urls;"; connection = new OdbcConnection(connectionStr); connection.Open(); selectCommand = new OdbcCommand(str,connection); adapter = new OdbcDataAdapter(selectCommand); ds = new DataSet(); adapter.Fill(ds,"urls"); DataGrid1.DataSource = ds; DataGrid1.DataMember = "urls"; DataGrid1.DataBind(); connection.Close(); } #region Web Form Designer generated code override protected void OnInit(EventArgs e) { // // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent(); base.OnInit(e); } /// /// Required method for Designer support - do not modify

      X Offline
      X Offline
      xrado
      wrote on last edited by
      #2

      im also playing with postgres odbc, but not working. have you found where is the problem??

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups