Omer Butt
Active member
- Joined
- Sep 6, 2021
- Messages
- 29
- Programming Experience
- Beginner
Hello, Please Help in this regard as I was very happy complete one phase of my work there was no error and everything worked just fine so I saved and closed the all the open instances of forms and user controls to start working on a new window form and went to have a little rest after a while when I came back I saw this error how it happens automatically by it self when I left with zero errors and now it showing me this error:
Here's a screenshot of this error:
Below in the Error List when I double Click on it it take me to the Administrator_Panel.Designer.cs Line 1092, Here's the screenshot of the code it leads to:
and if you see the instance of the error in call stack in first screenshot you can see it leads to the UC_Profile.cs: Line 29. Here's the screenshot of that Part of the code:
Due to this error I am unable to open the Administrator Panel as you can see above in first screenshot Please guide how to resolve this error.....
Value cannot be null. Parameter name: source
Here's a screenshot of this error:
Below in the Error List when I double Click on it it take me to the Administrator_Panel.Designer.cs Line 1092, Here's the screenshot of the code it leads to:
Administrator_Panel_Designer.cs Code that the Error List Message directs to:
// Administrator_Panel
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(1366, 768);
this.Controls.Add(this.panel4);
this.Controls.Add(this.Panel_Admin_NavUCs);
this.Controls.Add(this.Panel_Admin_DigClock);
this.Controls.Add(this.Panel_Admin_NavBtns);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "Administrator_Panel";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Administrator_Panel";
this.Load += new System.EventHandler(this.Administrator_Panel_Load);
this.Panel_Admin_NavBtns.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.PicBox_Main_Admin_UserPic)).EndInit();
this.Panel_Admin_DigClock.ResumeLayout(false);
this.Panel_DigitalClock.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.bunifuPictureBox1)).EndInit();
this.Panel_Admin_NavUCs.ResumeLayout(false);
this.ResumeLayout(false);
}
and if you see the instance of the error in call stack in first screenshot you can see it leads to the UC_Profile.cs: Line 29. Here's the screenshot of that Part of the code:
UC_Profile.cs Code:
private void UC_Profile_Load(object sender, EventArgs e)
{
var msUp = Login_Form.Upic;
var bytes = msUp.ToArray();
var ImageMemoryStream = new MemoryStream(bytes);
Image ImgFromStream = Image.FromStream(ImageMemoryStream);
PicBox_Profile_Picture.Image = ImgFromStream;
Lbl_ProfileName.Text = Login_Form.UName;
Query = "select * from Tb_Users where User_Name='" + Lbl_ProfileName.Text + "'";
SqlDataAdapter ProfileData = new SqlDataAdapter(Query, Conn.Connect);
DataTable dt = new DataTable();
ProfileData.Fill(dt);
DropDown_Profile_UserRole.Text = dt.Rows[0][1].ToString();
Txt_Profile_Name.Text = dt.Rows[0][2].ToString();
Txt_Profile_DOB.Text = dt.Rows[0][3].ToString();
Txt_Profile_Mobile.Text = dt.Rows[0][4].ToString();
Txt_Profile_Email.Text = dt.Rows[0][5].ToString();
Txt_Profile_Password.Text = dt.Rows[0][7].ToString();
Lbl_Profile_UserRole.Text = dt.Rows[0][1].ToString();
Lbl_Profile_DOB.Text = dt.Rows[0][3].ToString();
Lbl_Profile_Mobile.Text = dt.Rows[0][4].ToString();
Lbl_Profile_Email.Text = dt.Rows[0][5].ToString();
Lbl_Profile_UserID.Text = dt.Rows[0][0].ToString();
}
Due to this error I am unable to open the Administrator Panel as you can see above in first screenshot Please guide how to resolve this error.....
Last edited: