Binding Individual row to individual labels

Course Queries Syllabus Queries 2 years ago

0 2 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Syllabus Queries related to Course Queries. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (2)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

 

// design

// in design view there are 10 labels (lblq1,lblq2....lblq10)

// Code

public void bindquestions() { try {

        strqry = "select DISTINCT feedbackformusers.questionid as questionid,questions.question as question from feedbackformusers inner join questions on feedbackformusers.questionid=questions.questionid where feedbackformusers.empid=@empid and feedbackformusers.feedbackformid=@feedbackformid and feedbackformusers.isactive='yes'";

//output of query

//questionid question

// 1 Teacher covers the whole syllabus prescribed by the University ?

// 2 Make the concept clear, simple and interesting ?

// 3 Simplifies difficult topics by giving examples and makes the lecture interesting.

// 4 Uses logical, purposeful and thought-provoking questions for student participation.

// 5 Availability beyond normal classes and cooperation to solve individual problems.

// 6 Speaks clearly and confidently with adequate loudness.

// 7 Maintains proper discipline in the classroom.

// 8 Motivates the students to grow higher in life and to improve their shortcomings.

// 9 Regularity and punctuality.

// 10 Motivates the students to ask questions and to give answers in the classroom.

        cmd = new SqlCommand(strqry, con);

        cmd.Parameters.AddWithValue("@empid", ddlemployee.SelectedValue);

        cmd.Parameters.AddWithValue("@feedbackformid",Session["feedbackformid"].ToString());
        if (con.State == ConnectionState.Closed)
        { con.Open(); }

         drd = cmd.ExecuteReader();

//i knw the code will written here

// and i want to bind the output questions with 10 labels of the designview.

// I'm confused what to do here, to bind with every individual labels,

// i hope now everyone can understand

    }
    catch (Exception a)
    {
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Alert", "alert('" + a.ToString() + "')", true);
    }
    finally
    {
        drd.Close();
        con.Close();
    }

}
profilepic.png
manpreet 2 years ago

Am not into asp.net much.. but using an adodb recordset u can access the database with an sql nd get each row from the recordset using its item property and assign it to label.text

in vb.net the label itself has a databinding property.. so its simple there.

in asp.net an adodb recordset or oledb table adapter should do fine i suppose


0 views   0 shares

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.

tuteehub community

Join Our Community Today

Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.

tuteehub community