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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. while adding row to gridview dynamically, i am getting this error.

while adding row to gridview dynamically, i am getting this error.

Scheduled Pinned Locked Moved ASP.NET
comdata-structuresdebugginghelp
7 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.
  • M Offline
    M Offline
    mnarayana3
    wrote on last edited by
    #1

    Keyword not supported: 'unicode'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentException: Keyword not supported: 'unicode'. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. I downloaded the source code from the gridview girl.com site . If u are not aware of the article then i will provide the article too.

    C 1 Reply Last reply
    0
    • M mnarayana3

      Keyword not supported: 'unicode'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentException: Keyword not supported: 'unicode'. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. I downloaded the source code from the gridview girl.com site . If u are not aware of the article then i will provide the article too.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      I suggest you buy a book and work through it so you know how to program instead of blindly copying code from various sites. Articles are great, but you should work through them so you understand the code. We can't help you, except to say that you've used the keyword 'unicode' and it's not supported. For more info, we need to see the code.

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      M 1 Reply Last reply
      0
      • C Christian Graus

        I suggest you buy a book and work through it so you know how to program instead of blindly copying code from various sites. Articles are great, but you should work through them so you understand the code. We can't help you, except to say that you've used the keyword 'unicode' and it's not supported. For more info, we need to see the code.

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        M Offline
        M Offline
        mnarayana3
        wrote on last edited by
        #3

        thanks for your suggestion. here is the code and try to help me. using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.OleDb; using System.Data.OracleClient; public partial class Default13 : System.Web.UI.Page { private void Createrow(Table childtable,int index) { GridViewRow row = new GridViewRow(-1, -1, DataControlRowType.DataRow, DataControlRowState.Normal); row.Cells.Add(createcolumn()); childtable.Rows.AddAt(index + 2, row); } private TableCell createcolumn() { TableCell tc = new TableCell(); tc.ColumnSpan = GridView1.Columns.Count; tc.Width = Unit.Percentage(100); DataSourceControl ds = createdatasource(); tc.Controls.Add(ds); tc.Controls.Add(createdetailsview(ds)); return tc; } private DataSourceControl createdatasource() { SqlDataSource ds = new SqlDataSource(); ds.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString2"].ConnectionString ; ds.SelectCommand = "SELECT DEPTNO, DNAME FROM DEPT1 where deptno=@deptno"; Parameter pc = new Parameter("deptno", TypeCode.String, GridView1.SelectedValue.ToString()); ds.SelectParameters.Add(pc); ds.ID = "SqlDataSource2"; return ds; } private static DetailsView createdetailsview(DataSourceControl ds) { DetailsView dv = new DetailsView(); dv.AutoGenerateRows = true; dv.DataSourceID = ds.ID; return dv; } protected void Page_Load(object sender, EventArgs e) { } protected void GridView1_PreRender(object sender, EventArgs e) { if (GridView1.SelectedRow!= null) { Table childtable = GridView1.SelectedRow.Parent as Table; if (childtable != null) Createrow(childtable, GridView1.SelectedIndex); } } protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { } }

        C 1 Reply Last reply
        0
        • M mnarayana3

          thanks for your suggestion. here is the code and try to help me. using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.OleDb; using System.Data.OracleClient; public partial class Default13 : System.Web.UI.Page { private void Createrow(Table childtable,int index) { GridViewRow row = new GridViewRow(-1, -1, DataControlRowType.DataRow, DataControlRowState.Normal); row.Cells.Add(createcolumn()); childtable.Rows.AddAt(index + 2, row); } private TableCell createcolumn() { TableCell tc = new TableCell(); tc.ColumnSpan = GridView1.Columns.Count; tc.Width = Unit.Percentage(100); DataSourceControl ds = createdatasource(); tc.Controls.Add(ds); tc.Controls.Add(createdetailsview(ds)); return tc; } private DataSourceControl createdatasource() { SqlDataSource ds = new SqlDataSource(); ds.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString2"].ConnectionString ; ds.SelectCommand = "SELECT DEPTNO, DNAME FROM DEPT1 where deptno=@deptno"; Parameter pc = new Parameter("deptno", TypeCode.String, GridView1.SelectedValue.ToString()); ds.SelectParameters.Add(pc); ds.ID = "SqlDataSource2"; return ds; } private static DetailsView createdetailsview(DataSourceControl ds) { DetailsView dv = new DetailsView(); dv.AutoGenerateRows = true; dv.DataSourceID = ds.ID; return dv; } protected void Page_Load(object sender, EventArgs e) { } protected void GridView1_PreRender(object sender, EventArgs e) { if (GridView1.SelectedRow!= null) { Table childtable = GridView1.SelectedRow.Parent as Table; if (childtable != null) Createrow(childtable, GridView1.SelectedIndex); } } protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { } }

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          and which line blows up ?

          Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

          M 1 Reply Last reply
          0
          • C Christian Graus

            and which line blows up ?

            Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

            M Offline
            M Offline
            mnarayana3
            wrote on last edited by
            #5

            I traced the page. Its giving error after the "Begin Pre render" event. Keyword not supported: 'unicode'. at System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) at System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value) at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) at System.Web.UI.WebControls.SqlDataSource.CreateConnection(String connectionString) at System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) at System.Web.UI.WebControls.DataBoundControl.PerformSelect() at System.Web.UI.WebControls.BaseDataBoundControl.DataBind() at System.Web.UI.WebControls.DetailsView.DataBind() at System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() at System.Web.UI.WebControls.DetailsView.EnsureDataBound() at System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() at System.Web.UI.Control.EnsureChildControls() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 0.0112214646844372 0.010079

            C 1 Reply Last reply
            0
            • M mnarayana3

              I traced the page. Its giving error after the "Begin Pre render" event. Keyword not supported: 'unicode'. at System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) at System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value) at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) at System.Web.UI.WebControls.SqlDataSource.CreateConnection(String connectionString) at System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) at System.Web.UI.WebControls.DataBoundControl.PerformSelect() at System.Web.UI.WebControls.BaseDataBoundControl.DataBind() at System.Web.UI.WebControls.DetailsView.DataBind() at System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() at System.Web.UI.WebControls.DetailsView.EnsureDataBound() at System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() at System.Web.UI.Control.EnsureChildControls() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 0.0112214646844372 0.010079

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              Have you thought to set a breakpoint, so you can see what *line* is blowing up ?

              Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

              M 1 Reply Last reply
              0
              • C Christian Graus

                Have you thought to set a breakpoint, so you can see what *line* is blowing up ?

                Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

                M Offline
                M Offline
                mnarayana3
                wrote on last edited by
                #7

                i did that too but every line is executing very well. At the end of lasat curly brace its giving error. i thought there is no error in the program. but i think the error i am getting is general error due to some settings. if anyone aware of this type of error then they may solve.

                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