Click here to Skip to main content
15,886,026 members
Home / Discussions / C#
   

C#

 
GeneralRe: Suggest a solution. Pin
Eddy Vluggen16-Oct-12 3:00
professionalEddy Vluggen16-Oct-12 3:00 
GeneralRe: Suggest a solution. Pin
Ambika Jadhav16-Oct-12 19:56
Ambika Jadhav16-Oct-12 19:56 
Questionplay video in memory stream Pin
SumithF15-Oct-12 19:48
SumithF15-Oct-12 19:48 
AnswerRe: play video in memory stream Pin
Pete O'Hanlon15-Oct-12 23:24
mvePete O'Hanlon15-Oct-12 23:24 
AnswerRe: play video in memory stream Pin
Eddy Vluggen16-Oct-12 2:00
professionalEddy Vluggen16-Oct-12 2:00 
QuestionVS2008 deployment not creating directories Pin
Wolfram Steinke15-Oct-12 15:04
Wolfram Steinke15-Oct-12 15:04 
AnswerRe: VS2008 deployment not creating directories Pin
Dave Kreskowiak15-Oct-12 17:29
mveDave Kreskowiak15-Oct-12 17:29 
QuestionNo overload takes 5 arguments error (C# datagrid) Pin
saiprakash031515-Oct-12 11:13
saiprakash031515-Oct-12 11: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
C#
 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 11:28
professionalRichard Andrew x6415-Oct-12 11:28 
QuestionRe: No overload takes 5 arguments error (C# datagrid) Pin
n.podbielski15-Oct-12 11:43
n.podbielski15-Oct-12 11:43 
AnswerRe: No overload takes 5 arguments error (C# datagrid) Pin
saiprakash031516-Oct-12 5:52
saiprakash031516-Oct-12 5:52 
QuestionConverting from C to C# Pin
AseelHadlaq15-Oct-12 6:53
AseelHadlaq15-Oct-12 6:53 
AnswerRe: Converting from C to C# Pin
fjdiewornncalwe15-Oct-12 7:06
professionalfjdiewornncalwe15-Oct-12 7:06 
AnswerRe: Converting from C to C# Pin
jschell15-Oct-12 7:40
jschell15-Oct-12 7:40 
GeneralRe: Converting from C to C# Pin
AseelHadlaq15-Oct-12 8:30
AseelHadlaq15-Oct-12 8:30 
GeneralRe: Converting from C to C# Pin
jschell15-Oct-12 12:46
jschell15-Oct-12 12:46 
GeneralRe: Converting from C to C# Pin
AseelHadlaq16-Oct-12 5:38
AseelHadlaq16-Oct-12 5:38 
GeneralRe: Converting from C to C# Pin
jschell16-Oct-12 8:36
jschell16-Oct-12 8:36 
AnswerRe: Converting from C to C# Pin
Dave Doknjas15-Oct-12 9:41
Dave Doknjas15-Oct-12 9:41 
GeneralRe: Converting from C to C# Pin
AseelHadlaq16-Oct-12 5:43
AseelHadlaq16-Oct-12 5:43 
AnswerRe: Converting from C to C# Pin
DaveyM6915-Oct-12 11:30
professionalDaveyM6915-Oct-12 11:30 
GeneralRe: Converting from C to C# Pin
AseelHadlaq16-Oct-12 5:45
AseelHadlaq16-Oct-12 5:45 
AnswerRe: Converting from C to C# Pin
Bernhard Hiller15-Oct-12 22:35
Bernhard Hiller15-Oct-12 22:35 
GeneralRe: Converting from C to C# Pin
AseelHadlaq16-Oct-12 5:49
AseelHadlaq16-Oct-12 5:49 
GeneralRe: Converting from C to C# Pin
Pete O'Hanlon16-Oct-12 6:21
mvePete O'Hanlon16-Oct-12 6: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.