Click here to Skip to main content
15,896,308 members
Home / Discussions / C#
   

C#

 
QuestionRuntime Web Service Invocation Pin
MrEyes13-Sep-07 22:49
MrEyes13-Sep-07 22:49 
AnswerRe: Runtime Web Service Invocation Pin
ElSpinos14-Sep-07 0:15
ElSpinos14-Sep-07 0:15 
GeneralRe: Runtime Web Service Invocation Pin
MrEyes14-Sep-07 1:04
MrEyes14-Sep-07 1:04 
QuestionDatabase and SQL Pin
halalalal13-Sep-07 22:22
halalalal13-Sep-07 22:22 
AnswerRe: Database and SQL Pin
\laddie13-Sep-07 22:25
\laddie13-Sep-07 22:25 
QuestionSmart Phone Devices Pin
halalalal13-Sep-07 21:57
halalalal13-Sep-07 21:57 
AnswerRe: Smart Phone Devices Pin
Dave Kreskowiak14-Sep-07 6:27
mveDave Kreskowiak14-Sep-07 6:27 
Questionhow to display data in list view of mdi children form on search criteria Pin
mukesh choudhary13-Sep-07 21:52
mukesh choudhary13-Sep-07 21:52 
form2 is mdi child form of form1.there is a listview control and a search button on form2.when execute the project, mdi parent form(form1) loads and when click on the form2 menu, form2 loads and data shows in the listview based on criteria. when click the search button of form2, a new form form3 opens which in not mdi child form. on form3, a textbox and a button(name-search).in form3,i give the text in textbox existing in listview column of form2 and click on button(name-search). it should dispay record on the same listview of form2,when form2 activates.when form3 close, form2 gets activated.
code of form2 button
public static string check="1";
form3 objFrm3=new form3();
objFrm3.show();

code for form2_activated event
public void form2_Activated(object sender, EventArgs e)
{
if (check != "1")
{
string records = form3.record;
string sqlQuery = "select * from emp where ename like '" + records + "'";
int count = listView1.Columns.Count;
search(sqlQuery, count);

}

private void search(string sqlQuery, int count)
{

SqlConnection objCon = new SqlConnection(objFunction.strConn);
SqlDataAdapter objAdapter = new SqlDataAdapter(sqlQuery, objCon);
DataSet objDs = new DataSet();
objAdapter.Fill(objDs, "f");
listView1.Items.Clear();

for (int i = 0; i < objDs.Tables[0].Rows.Count; i++)
{
DataRow objDr = objDs.Tables[0].Rows[i];
ListViewItem objLv1 = new ListViewItem(objDr[0].ToString());
for (int j = 1; j < count; j++)
{

objLv1.SubItems.Add(objDr[j].ToString());

}

listView1.Items.Add(objLv1);
}
listView1.Items[0].Focused = true;

}

code of form3 of button(name-search)
public static string record=textBox1.Text;
form2.check = "2";
form2 objFrm2 = new form2();
objFrm2.form2_Activated(sender, e);
this.Close();


best regards,
mukesh

QuestionCreateDataReader from DataSet in Visual Studio 2003 Pin
Diego F.13-Sep-07 21:43
Diego F.13-Sep-07 21:43 
AnswerRe: CreateDataReader from DataSet in Visual Studio 2003 Pin
Pete O'Hanlon13-Sep-07 21:54
mvePete O'Hanlon13-Sep-07 21:54 
AnswerRe: CreateDataReader from DataSet in Visual Studio 2003 Pin
Colin Angus Mackay13-Sep-07 21:56
Colin Angus Mackay13-Sep-07 21:56 
QuestionCaller ID Pin
p_iranmehr13-Sep-07 21:24
p_iranmehr13-Sep-07 21:24 
AnswerRe: Caller ID Pin
J a a n s13-Sep-07 21:34
professionalJ a a n s13-Sep-07 21:34 
QuestionSend a message to a control Pin
vikas maan13-Sep-07 21:12
vikas maan13-Sep-07 21:12 
AnswerRe: Send a message to a control Pin
\laddie13-Sep-07 21:28
\laddie13-Sep-07 21:28 
QuestionSend a message to a control Pin
vikas maan13-Sep-07 21:12
vikas maan13-Sep-07 21:12 
AnswerRe: Send a message to a control Pin
\laddie13-Sep-07 21:27
\laddie13-Sep-07 21:27 
QuestionTo search and copy from server Pin
P_Elza13-Sep-07 21:11
P_Elza13-Sep-07 21:11 
AnswerRe: To search and copy from server Pin
\laddie13-Sep-07 21:24
\laddie13-Sep-07 21:24 
GeneralRe: To search and copy from server Pin
P_Elza13-Sep-07 21:45
P_Elza13-Sep-07 21:45 
QuestionHelp me Pin
P_Elza13-Sep-07 22:09
P_Elza13-Sep-07 22:09 
GeneralRe: To search and copy from server Pin
Joe13-Sep-07 22:13
Joe13-Sep-07 22:13 
QuestionRe: To search and copy from server Pin
P_Elza13-Sep-07 22:28
P_Elza13-Sep-07 22:28 
AnswerRe: To search and copy from server Pin
Pete O'Hanlon14-Sep-07 0:21
mvePete O'Hanlon14-Sep-07 0:21 
AnswerRe: To search and copy from server Pin
rohitsrivastava13-Sep-07 23:01
rohitsrivastava13-Sep-07 23:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.