Welcome to Dream.In.Code
Getting C# Help is Easy!

Join 119,059 C# Programmers for FREE! Ask your question and get quick answers from experts. There are 1,504 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Exception

 
Reply to this topicStart new topic

Exception

divyapagidela
post 6 Aug, 2008 - 12:01 AM
Post #1


New D.I.C Head

*
Joined: 23 Jul, 2008
Posts: 15



Thanked 1 times
My Contributions


Hiiiiiiii
I'm doing a project which includes 'saving mails' as a part.
when i try to fill the details in table,i'm getting the following error.
"Indexoutofrange Exception"
What should i do
I have done all that i can do
Plzzzzz do needful 4 me as sooon as possible
Thanx in advance smile.gif
byeee
User is offlineProfile CardPM

Go to the top of the page


PsychoCoder
post 6 Aug, 2008 - 01:03 AM
Post #2


using DIC.Core;

Group Icon
Joined: 26 Jul, 2007
Posts: 7,954



Thanked 85 times

Dream Kudos: 8100

Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, GDI, Boo.Net

My Contributions


Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Please post like this:

Thank you for helping us helping you.


Why don't you post the code you currently have so we can tr4y and help debug it for you.
User is offlineProfile CardPM

Go to the top of the page

divyapagidela
post 6 Aug, 2008 - 01:34 AM
Post #3


New D.I.C Head

*
Joined: 23 Jul, 2008
Posts: 15



Thanked 1 times
My Contributions


here is my code
CODE


protected void Button6_Click(object sender, EventArgs e)
    {

      
            SqlConnection con2 = new SqlConnection(@"Data Source=DIVYA;Initial Catalog=divproject;Integrated Security=True");
            SqlDataAdapter da2 = new SqlDataAdapter("select * from counter", con2);
            DataSet ds2 = new DataSet();
            da2.Fill(ds2, "counter");
            if (ds2.Tables["counter"].Rows[0][0].ToString() != null)
            {
                TextBox1.Text = ds2.Tables["counter"].Rows[0][0].ToString();
                TextBox2.Text = ds2.Tables["counter"].Rows[0][1].ToString();
                TextBox3.Text = ds2.Tables["counter"].Rows[0][2].ToString();

                TextBox1.Text = "";
                TextBox3.Text = "";
                Response.Write("Ur message has been sent successfully");

            }


The above code is for saving message details in a table....
When i try to run the code,I'm getting the exceptions like
1."Indexoutofrange"
2."There is no row at position 0."

Whats the reason ,I'm getting these errors
plzzzzzzz help me if anyone know.........
As soon as possible
Thanx in advance
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 10/13/08 03:44PM

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month