2
Answers

plz solve this error

abhilash skumar

abhilash skumar

16y
2.6k
1

am a begniner in C#. i am doing  Address Book project in C# visual studio 2005 .2.0 frame work.the code is below.when i use this code in VS2003 it works .nw when i used in VS2005..it shows the following error--

1.error-'System.Configuration.ConfigurationSettings.AppSettings' is obsolete: 'This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings' C:\Documents and Settings\Abilash\My Documents\Visual Studio 2005\Projects\WindowsApplication11\WindowsApplication11\AddressManager.cs 13 39 WindowsApplication11

code is-

public static void DeleteAddress(System.Int32 RecId)

{

String ConnectionString = System.Configuration.ConfigurationSettings.AppSettings["AddressDB"];--(error)

OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\db3.mdb;Password=;");

String query = " delete from Address where RecId = " + RecId;

DataManager.ExecuteNonQuery(ConnectionString,query);

}

2.error--Error 8 No overload for method 'Select' takes '1' arguments C:\Documents and Settings\Abilash\My Documents\Visual Studio 2005\Projects\WindowsApplication11\WindowsApplication11\Form1.cs 277 13 WindowsApplication11

code is-

private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)

{

dataGridView1.Select(dataGridView1.CurrentRow.Index);--(eror)

LoadCurrentItem();

SetEditState(false);

}


 

Answers (2)
0
abhilash skumar

abhilash skumar

NA 4 0 16y

thanks for your valuable reply sir..in ur last reply i tried to use

System.Configuration.ConfigurationManager.Appsetting[]..

but i did not found ConfigurationManager after Entering "System.Configuration."

and sir i created table in Microsoft Acess 2003.My second error is in Main form the error is in this red marked code.and Error is-

" No overload Method 'Select' takes '1' argument

code :

private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)

{

dataGridView1.Select(dataGridView1.CurrentRow.Index);

LoadCurrentItem();

SetEditState(false);

}

 

0
Niradhip Chakraborty

Niradhip Chakraborty

NA 6.5k 526.7k 16y

Don't use ConfigurationSettings.AppSettings. Use
ConfigurationManager.AppSettings and use class (using System.Configuration;)

SqlConnection con1 = null;
con1 = new SqlConnection(ConfigurationManager.AppSettings["con"].ToString());