Change the form name on page load with the data base details

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sathish201089
    New Member
    • Dec 2012
    • 1

    Change the form name on page load with the data base details

    hi everyone, I want to know how to change the form name on load with database table column id

    i mean my form name should be

    DOMain (DO# 200100)

    Here,

    DOMain : Form Name (I.E) Text
    DO# 200100: is the database Table Column ID


    i used this code but no use

    Code:
    public DOMain()
            {
                InitializeComponent();
                DataTable dt3 = new DataTable();
                OleDbConnection conn1 = new OleDbConnection("connection string");
                conn1.Open();
                OleDbCommand c = new OleDbCommand("select * from dbo_PO where DOC_NO = '"+DebitOrder+"'", conn1);
                OleDbDataAdapter d = new OleDbDataAdapter(c);
                d.Fill(dt3);
                if(dt3.Rows.Count>0)
                {
                    this.Text = "sathish" + dt3.Rows[0]                         ["DOC_NO"].ToString();
                }
                
            }
    Last edited by Meetee; Dec 14 '12, 10:20 AM. Reason: Use code tags <code/> around your code
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Your question is vague and unclear, I have no idea what you're trying to do.

    Comment

    Working...