Click here to Skip to main content
12,757,504 members (38,770 online)
   

C#

 
GeneralRe: Suggest a solution. Pin
Eddy Vluggen16-Oct-12 4:00
memberEddy Vluggen16-Oct-12 4:00 
GeneralRe: Suggest a solution. Pin
Ambika Jadhav16-Oct-12 20:56
memberAmbika Jadhav16-Oct-12 20:56 
Questionplay video in memory stream Pin
SumithF15-Oct-12 20:48
memberSumithF15-Oct-12 20:48 
AnswerRe: play video in memory stream Pin
Pete O'Hanlon16-Oct-12 0:24
protectorPete O'Hanlon16-Oct-12 0:24 
AnswerRe: play video in memory stream Pin
Eddy Vluggen16-Oct-12 3:00
memberEddy Vluggen16-Oct-12 3:00 
QuestionVS2008 deployment not creating directories Pin
Wolfram Steinke15-Oct-12 16:04
memberWolfram Steinke15-Oct-12 16:04 
AnswerRe: VS2008 deployment not creating directories Pin
Dave Kreskowiak15-Oct-12 18:29
mvpDave Kreskowiak15-Oct-12 18:29 
QuestionNo overload takes 5 arguments error (C# datagrid) Pin
saiprakash031515-Oct-12 12:13
membersaiprakash031515-Oct-12 12:13 
Hi,
I'm working with two datables in the same dataset. My first Table is 'Address_Table' which contains a_id (which is PK), s_id (which is FK referencing 'Students' Table S_ID), address, city state, zip. (which are displayed in text boxes) My second table 'Students' contains S_ID (PK), Name, Degree,Class, Percentage (Which are displayed in a Grid). My Question when i enter the text in the texboxes and in GridView and Click 'Save' both those data needs to stored into the 'Address_Table' and 'Students' respectively. I'm having no problems saving the data in the gridview but however getting this error at this line when i'm trying to send the textboxes.
this.address_TableTableAdapter.Fill(this.studentsDataSet.Address_Table,txtAddress.Text, txtCity.Text, cboState.Text,txtZip.Text); //No overload takes 5 arguments error.
Let me know if i did something wrong or if i have to add some more stuff Thanks

Sai

Here is the code
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 students_normalization
{
    public partial class DegreeForm : Form
    {
        public DegreeForm()
        {
            InitializeComponent();
        }

        private void DegreeForm_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'studentsDataSet.Address_Table' table. You can move, or remove it, as needed.
            this.address_TableTableAdapter.Fill(this.studentsDataSet.Address_Table);

            try
            {
                // TODO: This line of code loads data into the 'studentsDataSet.Students' table. You can move, or remove it, as needed.
                this.studentsTableAdapter.Fill(this.studentsDataSet.Students);
            }
            catch (SqlException ex)
            {
                MessageBox.Show("Database Error # " + ex.Number + ": " + ex.Message, ex.GetType().ToString());
            }
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
           // DialogResult dialogResult = ("Do you want to Save Data?","Save Data", MessageBoxButtons.YesNo);

            if(MessageBox.Show("Do you want to Save or Update a record","Update Record",MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
 
            this.Validate();
            this.studentsBindingSource.EndEdit();
            this.addressTableBindingSource.EndEdit();
            this.studentsTableAdapter.Update(this.studentsDataSet);
            this.address_TableTableAdapter.Update(this.studentsDataSet);
            this.studentsTableAdapter.Fill(this.studentsDataSet.Students);
            this.address_TableTableAdapter.Fill(this.studentsDataSet.Address_Table,txtAddress.Text, txtCity.Text, cboState.Text,txtZip.Text); //No Overload takes 5 arguments Error
            }
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Do you want to Cancel", "Cancel", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                this.studentsBindingSource.CancelEdit();
            }

        }

        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Do you want to Delete the Record", "Delete Record", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                this.studentsBindingSource.RemoveCurrent();
                this.studentsTableAdapter.Update(this.studentsDataSet);
            }
        }


       

    }
}


AnswerRe: No overload takes 5 arguments error (C# datagrid) Pin
Richard Andrew x6415-Oct-12 12:28
memberRichard Andrew x6415-Oct-12 12:28 
QuestionRe: No overload takes 5 arguments error (C# datagrid) Pin
n.podbielski15-Oct-12 12:43
membern.podbielski15-Oct-12 12:43 
AnswerRe: No overload takes 5 arguments error (C# datagrid) Pin
saiprakash031516-Oct-12 6:52
membersaiprakash031516-Oct-12 6:52 
QuestionConverting from C to C# Pin
AseelHadlaq15-Oct-12 7:53
memberAseelHadlaq15-Oct-12 7:53 
AnswerRe: Converting from C to C# Pin
Marcus Kramer15-Oct-12 8:06
memberMarcus Kramer15-Oct-12 8:06 
AnswerRe: Converting from C to C# Pin
jschell15-Oct-12 8:40
memberjschell15-Oct-12 8:40 
GeneralRe: Converting from C to C# Pin
AseelHadlaq15-Oct-12 9:30
memberAseelHadlaq15-Oct-12 9:30 
GeneralRe: Converting from C to C# Pin
jschell15-Oct-12 13:46
memberjschell15-Oct-12 13:46 
GeneralRe: Converting from C to C# Pin
AseelHadlaq16-Oct-12 6:38
memberAseelHadlaq16-Oct-12 6:38 
GeneralRe: Converting from C to C# Pin
jschell16-Oct-12 9:36
memberjschell16-Oct-12 9:36 
AnswerRe: Converting from C to C# Pin
Dave Doknjas15-Oct-12 10:41
memberDave Doknjas15-Oct-12 10:41 
GeneralRe: Converting from C to C# Pin
AseelHadlaq16-Oct-12 6:43
memberAseelHadlaq16-Oct-12 6:43 
AnswerRe: Converting from C to C# Pin
DaveyM6915-Oct-12 12:30
mentorDaveyM6915-Oct-12 12:30 
GeneralRe: Converting from C to C# Pin
AseelHadlaq16-Oct-12 6:45
memberAseelHadlaq16-Oct-12 6:45 
AnswerRe: Converting from C to C# Pin
Bernhard Hiller15-Oct-12 23:35
memberBernhard Hiller15-Oct-12 23:35 
GeneralRe: Converting from C to C# Pin
AseelHadlaq16-Oct-12 6:49
memberAseelHadlaq16-Oct-12 6:49 
GeneralRe: Converting from C to C# Pin
Pete O'Hanlon16-Oct-12 7:21
protectorPete O'Hanlon16-Oct-12 7:21 

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.


Advertise | Privacy | Mobile
Web01 | 2.8.170217.1 | Last Updated 24 Feb 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid