Click here to Skip to main content
15,923,557 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Clear the textboxes in logincontrol if login fails. Pin
Shrinivas Singh20-Mar-09 21:30
Shrinivas Singh20-Mar-09 21:30 
GeneralRe: Clear the textboxes in logincontrol if login fails. Pin
SreejithAchutan20-Mar-09 21:40
SreejithAchutan20-Mar-09 21:40 
GeneralRe: Clear the textboxes in logincontrol if login fails. Pin
Shrinivas Singh20-Mar-09 21:50
Shrinivas Singh20-Mar-09 21:50 
GeneralRe: Clear the textboxes in logincontrol if login fails. Pin
SreejithAchutan20-Mar-09 22:47
SreejithAchutan20-Mar-09 22:47 
GeneralRe: Clear the textboxes in logincontrol if login fails. Pin
Yusuf21-Mar-09 4:16
Yusuf21-Mar-09 4:16 
GeneralRe: Clear the textboxes in logincontrol if login fails. Pin
vinodkrebc22-Mar-09 18:41
vinodkrebc22-Mar-09 18:41 
GeneralRe: Clear the textboxes in logincontrol if login fails. Pin
Yusuf23-Mar-09 3:16
Yusuf23-Mar-09 3:16 
QuestionMove datagridview records from one form to another [modified] Pin
pradeepc_mca20-Mar-09 21:00
pradeepc_mca20-Mar-09 21:00 
Hi,
Am working on ASP.Net windows application. I have a form2 which searches records from
database based on search word entered in textbox and it displays list of records in a datagridview in form2 and i have provided a view button inside datagridview column. on click of view button the particular record details will be displayed in form3. Now i have to place next button in the form3 which should move through all the records on click of next button. How to traverse through all records on click of a button. Am getting error as cannot convert from System.EventArgs to System.Windows.Forms.dataGridViewCellEventArgs.

Thanks in advance.

//Form2


        public void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            sample(this,e); 
        }

        public int sample(object sender, DataGridViewCellEventArgs e)
        {
            currentRow = e.RowIndex;

            try
            {
                IdString = dataGridView1[0, currentRow].Value.ToString();
                
                nextrow = dataGridView1[0, currentRow + 1].Value.ToString());
                
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            if (dataGridView1.Columns[e.ColumnIndex] == editButton && currentRow >= 0)
            {
                string FileName = dataGridView1[1, currentRow].Value.ToString();
                string Fileno = dataGridView1[2, currentRow].Value.ToString();
                string Filetype = dataGridView1[3, currentRow].Value.ToString();
                string Address = dataGridView1[4, currentRow].Value.ToString();
                //this.Hide(); 
                Form3 f3 = new Form3(IdString, nextrow);
                f3.Show();
            }
               return nextrow;
         }
}


//Form3

        public void button3_Click(object sender, EventArgs e)
        {            
           exam(this, e);  //am getting error here. so wat parameter i need to pass since for button click event i cant add DataGridViewCellEventArgs               
        }

        public void exam(object sender, DataGridViewCellEventArgs e)
        {
            Form2 frm2 = new Form2();
            test1 = frm2.sample(this, e);
            myConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\DFMS\\DFMS.mdb");
            myConnection.Open();

            string query = "select SlNo, FileName, Fileno, Fileloc, Filetype, Address, Surveyno, A, G, Sqmt, Resdate, Issueddate, Remarks from SRCH where (id = " + test1 + ")";
            OleDbCommand cmd = new OleDbCommand(query, myConnection);
            OleDbDataReader dr = cmd.ExecuteReader();

            while (dr.Read())
            {
                label26.Text = dr["SlNo"].ToString();
                label24.Text = dr["FileName"].ToString();
                label23.Text = dr["Fileno"].ToString();
                label22.Text = dr["Fileloc"].ToString();
                label21.Text = dr["Filetype"].ToString();
                label20.Text = dr["Address"].ToString();
                label19.Text = dr["Surveyno"].ToString();
                label18.Text = dr["A"].ToString();
                label17.Text = dr["G"].ToString();
                label16.Text = dr["Sqmt"].ToString();
                label15.Text = dr["Resdate"].ToString();
                label14.Text = dr["Issueddate"].ToString();
                label13.Text = dr["Remarks"].ToString();
            }
            myConnection.Close();
            test1 = test1 + 1;
        }
    }
}


modified on Saturday, March 21, 2009 8:10 AM

AnswerRe: Move datagridview records from one form to another Pin
Abhijit Jana21-Mar-09 1:59
professionalAbhijit Jana21-Mar-09 1:59 
GeneralRe: Move datagridview records from one form to another Pin
pradeepc_mca21-Mar-09 2:40
pradeepc_mca21-Mar-09 2:40 
GeneralRe: Move datagridview records from one form to another Pin
Abhijit Jana21-Mar-09 3:02
professionalAbhijit Jana21-Mar-09 3:02 
QuestionServer was unable to process request Pin
kvijayajyothy20-Mar-09 20:41
kvijayajyothy20-Mar-09 20:41 
AnswerRe: Server was unable to process request Pin
Abhijit Jana21-Mar-09 1:25
professionalAbhijit Jana21-Mar-09 1:25 
AnswerRe: Server was unable to process request Pin
Yusuf21-Mar-09 4:19
Yusuf21-Mar-09 4:19 
QuestionMy first published ASP.NET project Pin
shabya20-Mar-09 20:16
shabya20-Mar-09 20:16 
AnswerRe: My first published ASP.NET project Pin
Abhijit Jana21-Mar-09 1:14
professionalAbhijit Jana21-Mar-09 1:14 
GeneralRe: My first published ASP.NET project Pin
shabya21-Mar-09 3:30
shabya21-Mar-09 3:30 
AnswerRe: My first published ASP.NET project Pin
vinodkrebc21-Mar-09 3:14
vinodkrebc21-Mar-09 3:14 
AnswerRe: My first published ASP.NET project Pin
Yusuf21-Mar-09 4:22
Yusuf21-Mar-09 4:22 
AnswerRe: My first published ASP.NET project Pin
tech60321-Mar-09 6:29
tech60321-Mar-09 6:29 
Questionhow to attach aspx pages to master page Pin
naveen attri20-Mar-09 20:16
naveen attri20-Mar-09 20:16 
AnswerRe: how to attach aspx pages to master page Pin
Abhijit Jana21-Mar-09 1:34
professionalAbhijit Jana21-Mar-09 1:34 
AnswerRe: how to attach aspx pages to master page Pin
Gaurav Mahajan21-Mar-09 1:55
Gaurav Mahajan21-Mar-09 1:55 
QuestionQuestion about MySql Database in C# Pin
Deepak the Cool20-Mar-09 20:09
Deepak the Cool20-Mar-09 20:09 
AnswerRe: Question about MySql Database in C# Pin
Gaurav Mahajan21-Mar-09 3:10
Gaurav Mahajan21-Mar-09 3:10 

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.