Click here to Skip to main content
15,914,111 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I work in Asp.net 2008 windowsFormapplication
I have two forms namely edit user and user wizard. At first time i want to select the user name from user wizard form so i add a button on the form. when I click the button the user wizard form display then i select the user name in there and return that value into the edit user .But there was a problem occurred ,2 edit user forms are
show. but i want the first time form only

Here i specifies my codes Please check it and give correct code

1 this code in user wizard

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace Zealian
{
    public partial class Client_Wizard : Form
    {
        string name;
        public string CLName
        {
            get
            {
                return  name ;
            }
        }
        SqlConnection con = new SqlConnection("server=.;database=zealian;uid=sa;pwd=sqladmin");
        public Client_Wizard()
        {
            InitializeComponent();
        }

        private void Client_Wizard_Load(object sender, EventArgs e)
        {
            
        }

      

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            label3.Visible = false;
            SqlDataAdapter da = new SqlDataAdapter("select * from addclient  where Client_Name LIKE '" + textBox1.Text + "%' OR ClientId LIKE '" + textBox1.Text + "%'", con);
            DataSet ds = new DataSet();
            da.Fill(ds);
            dataGridView1.DataSource = ds.Tables[0];
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Project_Details pd = new Project_Details();
            pd.Clientname = CLName;
            pd.Show();
            this.Close();
        }

        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            SqlDataAdapter da = new SqlDataAdapter("select Client_Name  from addclient  where ClientId='" + dataGridView1.CurrentRow.Cells[0].Value.ToString() + "'", con);
            DataSet ds = new DataSet();
            da.Fill(ds);
            name = ds.Tables[0].Rows[0]["Client_Name"].ToString();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            ViewClient vc = new ViewClient();
            vc.Clientname = CLName;
            vc.Show();
            this.Close();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Edit_Client ec = new Edit_Client();
            ec.Clientname = CLName;
            ec.Show();
            this.Close();

        }
    }
}


2. this code in edit user
C#
public partial class Edit_Client : Form
   {
       public string Clientname
       {
           set
           {

               textBox8.Text = value;
           }
       }
       string id;
       SqlConnection con = new SqlConnection("server=.;database=zealian;uid=sa;pwd=sqladmin");
       public Edit_Client()
       {
           InitializeComponent();
       }
Posted
Updated 29-Sep-11 1:20am
v2
Comments
Arun Kumar K S 29-Sep-11 7:43am    
What is your exact problem...?
Arun Kumar K S 29-Sep-11 7:48am    
Its not an asp.net application,its purely a windows application and please mention your problem

1 solution

alternate way to create wizard, use tab control without tab header and change tab index on next button this link may be useful TabControl on a WinForm without showing the Tab header?[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900