1
Answer

The application has failed to start because config.dll was not found. Reinstalling the application may fix the problem

learner learner

learner learner

12y
2.8k
1
I have developed a program in c#.net 4. When the application is executed directly by clicking exe file in the debug folder then an MDI form is open. When I click on a button in the MDI form to open another form then it shows the following error:

"The application has failed to start because config.dll was not found. Reinstalling the application may fix the problem"

But when the application is run from the source code in VS 2010 then no error is shown.
I didn't use any config.dll in my application.
I couldn't figure out the problem?
Answers (1)
1
Mamta M

Mamta M

NA 15k 2.1m 13y
you will need to write a SELECT query and retrieve information from the table into a datareader and then read records from the datareader

the SELECT statement can be similar to below:

SELECT time from movies where mov="lion" and day="sunday"

then in the while loop where you are interating through the datareader,
assign the datareader's first value into the first element of an array and next value to the next element

int i=0;

while(reader.Read())
{
strTime[i] = reader.GetString(0).ToString();
...
}

txtTime1.Text = strTime[0];
txtTime2.Text = strTime[1];
Accepted
1
Priya Linge

Priya Linge

NA 5k 708.2k 13y
Hi Neha,

I have one table name Customer ,it has two columns name ID and Name.
Just add connection to this table from sqlserver,Select 1 column name 'Name'  from that table.

 string query = "select Name from Customer";

fill this data in dataset as below.
here we got the column and rows of table.

ds.Tables[0] means in ds we have Customer table data.

Customer Table
Id   Name
1    Vinay
2    Prakash
3    samir

As per you requirement we want diff vaules from same column ,let's say Name column.

I took ds.Tables[0].Row[0][0].

here Tables[0] ---------Customer Table which is in sql.

Row[0]--------------From Customer first name here we get 'Vinay'
[0]------------------Indiactes First column(Name) as i took in my query. Select Name from Customer.

ds.Tables[0].Row[1][0].

Row[1]--------------From Customer first name here we get Prakash
[0]------------------From same column means Name column.

I hope you get the idea about mentioned code.

Thanks.
0
neha dhiman

neha dhiman

NA 14 9.9k 13y
hey priya thanx 4 replyin..but actually i am new at this so ..i dont know how to run the extracted file...if possible please reply back and explain the steps so that i can run the extracted files..i am having visual studio 2008 version and microsoft sql server management studio 2008....thanx..
0
Dinesh Beniwal

Dinesh Beniwal

Admin 16.4k 5.8m 13y
Hi Neha,

If your query is Solved then Mark as accepted answer.
0
neha dhiman

neha dhiman

NA 14 9.9k 13y
Thanku so much..it worked...
0
Priya Linge

Priya Linge

NA 5k 708.2k 13y

Attachment samevaule.rar

Hi Neha,

You want to display two diff values form same coloumn in textbox, you can do it by following way.

public partial class Form1 : Form
    {
        SqlConnection sqlConnection = new SqlConnection("Data Source=TFSERVER;Initial Catalog=pub4;Persist Security Info=True;User ID=trustfort;Password=Admin@123");
        SqlCommand sqlCommand;
        SqlDataReader sqlReader;
        SqlDataAdapter da;
        DataSet ds;
        public Form1()
        {
            InitializeComponent();
            getdata();
        }
   
        public void getdata()
        {
          
            string query = "select Name from Customer";
            sqlConnection.Open();
            sqlCommand = new SqlCommand(query, sqlConnection);
            da = new SqlDataAdapter(sqlCommand);
            ds = new DataSet();
            da.Fill(ds);
            //DataTable tb = ds.Tables[0];
            txtfirst.Text = ds.Tables[0].Rows[0][0].ToString();
            txtsecond.Text=ds.Tables[0].Rows[1][0].ToString();
         

        }
    }

Please check attached file.

Hope this will help you.

Thanks.