6
Answers

Asp.net server migration from 2003 to 2008 configuration fil

Anup

Anup

9y
645
1

I have a windows application program, exe for this application is executed remotely by some other system. Now there are server upgrade activity carried out and application is moved to new server 2008 from 2003

There is no change in configuration section made by me.

Here is how the config file looks like

<?xml version="1.0" encoding="utf-8" ?> <configuration>     <configSections>     <section name="somesettings" type="Someapplication.Infrastructure.somesettings" requirePermission="false" /> </configSections>  <somesettings setting1="Value1" setting2="value two"                    setting3="third value" /> </configuration>

Now the issue is, post migration from 2003 ( 32 bit ) to 2008 ( 64 bit ) the windows application could not read the custom configuration defined at configSections section.

Not able to find settings required post migration which will enable the program to read config sections settings.

Any help will be appreciated !

Answers (6)
0
Niradhip Chakraborty

Niradhip Chakraborty

NA 6.5k 526.8k 15y

1) DataReader does not implement any specific interface so that it can
be bindable
2) DataReader is for reading data.So if some how u r able to bind
that,it won't allow u to edit that.So it's of no use.
3) DataReader is forward only,that means u can get a record at a time
but can't traverse back to the prev record.

This code shows how to bind gridview with data reader
Use this code on page load

 
void Page_Load(Object sender, EventArgs e)
{
  String Q;
  Sql command cmd;
  Sql DataReader dr;


  SqlConnection conn = new SqlConnection();

  conn.ConnectionString = ConfigurationManager.ConnectionStrings        ["cn"].ConnectionString.ToString();

conn.Open();
         
Q = "select * from tablename";
              
cmd= New Sqlcommand(Q, conn); 
         
dr = cmd.ExecuteReader();         
         
Gridview1.DataSource = dr;
           
Gridview1.DataBind();
}

 
0
Kirtan Patel

Kirtan Patel

NA 35k 2.8m 15y
When you bind Data reader to gridView


it iterates through  records one by one and All records Rendered One bye one in HTML Table row

so as a result you see data in Grid View .