3 Replies - 292 Views - Last Post: 15 February 2013 - 09:09 AM Rate Topic: -----

#1 Leader2000  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 05-February 13

Pull it out on a report. But how?

Posted 15 February 2013 - 07:57 AM

Hi!

With this code below I can find one record on my "last_name" column. But there is a think I would like to learn that until now I didnt. I want to pull out this data I on a report builder.

I already have the bascis to create and save a report from report builder. Then I want to know how to generate from these codes?

private void btnFind_Click(object sender, EventArgs e)
string searchFor = textBox5.Text;

            int results = 0;
            DataRow[] returnedRows;

            returnedRows = ds1.Tables["Workers"].Select("last_name='" + searchFor + "'");            
            results = returnedRows.Length;

            if (results > 0)
            {
                DataRow dr1;
                dr1 = returnedRows[0];

                MessageBox.Show(dr1[1].ToString() + " " + dr1[2].ToString());
            }
            else
            {
                MessageBox.Show("No such Record");
            }
        }
    }
}


Is This A Good Question/Topic? 0
  • +

Replies To: Pull it out on a report. But how?

#2 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5674
  • View blog
  • Posts: 12,186
  • Joined: 02-June 10

Re: Pull it out on a report. But how?

Posted 15 February 2013 - 08:26 AM

Your question is really, really, hard to cut through and make sense out of.

It mostly sounds like you're asking for someone to build your report for you. We don't write your code, or design your application for you. You have to do your own coding and architecture design. We'll help you with specific problems but not "how do I do my job?" or "how do I design my entire application?"
Was This Post Helpful? 0
  • +
  • -

#3 h4nnib4l  Icon User is offline

  • The Noid
  • member icon

Reputation: 1182
  • View blog
  • Posts: 1,677
  • Joined: 24-August 11

Re: Pull it out on a report. But how?

Posted 15 February 2013 - 08:54 AM

I understand your question as this: How, from my 27 lines of code (generously including curly braces and empty lines), would I build a report generator?

The answer is: start. Model what the report should look like. Model how it should be generated. Model how it's going to integrate with the rest of your program (hint: it should be easy, it doesn't look like there's much to it). Once you've modeled it, start writing it. If you hit specific snags, come back and ask for help. But if you can't figure out how to make a big piece of the puzzle work, then you're not ready to write that piece and should go learn some more. If you are literally stuck and have no clue how to make something happen, it's because you don't know enough about the language and the paradigm you're trying to program within in general. There's nothing wrong with that, except that when you ask questions at that basic of a level, you're basically asking us to teach you to program. We paid money to learn (whether buying books, utilizing personal time that could have been spent earning income, or paying for courses or even University degrees) and invested a lot of our time: we're not going to teach you, there are already practically limitless resources from which to learn. So go find some and do it, because this can be a lot of fun.
Was This Post Helpful? 0
  • +
  • -

#4 Leader2000  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 05-February 13

Re: Pull it out on a report. But how?

Posted 15 February 2013 - 09:09 AM

ok. I will try out to write my codes. thanks
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1