TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sousa Pambo
NA
92
23.9k
Use the same form to search data for many forms
Aug 12 2014 5:57 AM
Hi fellows, please help me on this..... here is my code. I use one form to search data to != forms using 'visible' validation, but i find this error.
" NullReferenceException was unhandled, Object reference not set to an instance of an object."
in one of the form needing data.....
public string IDSet
{
set { tb_IdFunc.Text = value; }
}
public string NomeSet
{
set { lbNomeFunc.Text = value; }
}
private void bt_Search_Click(object sender, EventArgs e)
{
if (tb_IdFunc.Text == "")
{
frmSearchFunc SF = new frmSearchFunc();
SF.Location = new System.Drawing.Point(CG.parameterXLocation(), CG.parameterYLocation());
SF.ShowDialog();
}
else
{
FuncDal.shearchFaltaID(this.lstFalta, this.dtDataFalta.Value.Month, this.dtDataFalta.Value.Year, Convert.ToInt32(this.tb_IdFunc.Text));
this.lbNomeFunc.Text = FuncDal.getFuncNam(this.tb_IdFunc.Text);
}
}
In search form.....
private void lstSearchFuncGeral_DoubleClick(object sender, EventArgs e)
{
//frmAtribuirFalta atribF = new frmAtribuirFalta();
frmAtribuirFalta atribF = (frmAtribuirFalta)Application.OpenForms["frmAtribuirFalta"];
configSubsidio cnfgSubs = (configSubsidio)Application.OpenForms["configSubsidio"];
try
{
if (atribF.Visible == true)
{
arrayDetail = FuncDal.FuncAllData(this.lstSearchFuncGeral.FocusedItem.SubItems[0].Text);
//nomeProp = arrayDetail[0].ToString().Trim() + " " + arrayDetail[17].ToString().Trim();
atribF.IDSet = dadosID;
atribF.NomeSet = dadosNome;
}
}
catch (Exception ex)
{
throw ex;
}
try
{
if (cnfgSubs.Visible == true)
{
arrayDetail = FuncDal.FuncAllData(this.lstSearchFuncGeral.FocusedItem.SubItems[0].Text);
cnfgSubs.IDSet = dadosID;
cnfgSubs.NomeSet = dadosNome;
}
}
catch (Exception ex)
{
throw ex;
}
this.Close();
}
Regards!
Reply
Answers (
14
)
code for panchayati raj or e-grampanchayat
number should come with space's in between