错误 1 “UpdateDataBase”方法没有任何重载采用“1”个参数

问题描述

错误 1 “UpdateDataBase”方法没有任何重载采用“1”个参数
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace 进销存管理系统
{
public partial class PopedomManage : Form
{
private DataSet ds = new DataSet();
private LinkDataBase link = new LinkDataBase();
private string sendTableName = ""用户清单"";
private string sendStrSQL = ""SELECT * from 用户清单 where 姓名<>'sys'"";
private DataTable popedomDataTable = new DataTable();
private bool blInitial = true;

    public PopedomManage()    {        InitializeComponent();    }    private void PopedomManage_Load(object sender System.EventArgs e)

{
this.ds = this.link.SelectDataBase(sendStrSQL sendTableName);

      this.dgrd_Popedom.DataSource = ds.Tables[0];    this.DataGridStateControl();    this.dgrd_Popedom.Select();    string selectedUserID= this .ds.Tables [0].Rows [0][0].ToString ();    string tempStrSQL= ""select 权限名称 from 权限名单 "" + "" where 用户编号 = '"" +        selectedUserID + ""'"";    popedomDataTable=link.SelectDataBase(tempStrSQL);    for (int i=0;i<popedomDataTable.Rows.Count;i++){for (int j=0;j<this.chkLst_Priority.Items.Count;j++){if (this.chkLst_Priority.Items[j].ToString().Trim()==popedomDataTable.    Rows[i][0].ToString().Trim()){this.chkLst_Priority.SetItemChecked(jtrue);       }    }}

}

    private void DataGridStateControl()    {        DataGridTableStyle ts = new DataGridTableStyle();        ts.AlternatingBackColor = Color.LightGray;        ts.MappingName = this.ds.Tables[0].TableName;        ts.AllowSorting = false;        int numCols = this.ds.Tables[0].Columns.Count;        this.dgrd_Popedom.TableStyles.Add(ts);    }    private void chkLst_Priority_ItemCheck(object sender System.Windows.Forms.ItemCheckEventArgs e)

{

if (blInitial == false)
{
if (e.CurrentValue.ToString()==""Unchecked"")
{
try
{

   string strUserName = this.dgrd_Popedom[this.dgrd_Popedom.CurrentCell.

RowNumber0].ToString().Trim();
string strPopedom = this.chkLst_Priority.SelectedItem.ToString();
string temSendStrSQL = ""insert 权限清单(用户编号,权限名称)values ('"" + strUserName+""''"" + strPopedom+""')"";

     this.link.UpdateDataBase(temSendStrSQL);

}
catch
{
MessageBox.Show(""数据库中的权限修改出错,请重试!""信息"");

}

}

 else if (e.CurrentValue.ToString()==""Chencked"")            {                try                 {                    string strUserName =  this.dgrd_Popedom[this.dgrd_Popedom.CurrentCell.            RowNumber0].ToString().Trim();                    string strPopedom =this.chkLst_Priority.SelectedItem.ToString();                    string tempSendStrSQL= "" delete from 权限清单 where (用户编号 = '"" +             strUserName + ""'"" + ""and 权限清单 = '"" + strPopedom + ""')"";                    this.link.UpdateDataBase ( tempSendStrSQL );                }                catch                 {                    MessageBox.Show(""数据库中的权限修改出错!""信息"");                }            }        }}    private void dgrd_Popedom_MouseUp(object sender System.Windows.Forms.MouseEventArgs e)

{
if (this.dgrd_Popedom.CurrentCell.RowNumber >= this.ds.Tables[0].Rows.Count)
//防止出现所选的用户不再数据表中的情况
{
return;
}
this.chkLst_Priority.Enabled=true;
blInitial=true; //控制当""权限管理""窗体刚生成时和单击其他用户时使

//CheckedListBox控件中数据发生改变时不响应ItemCheck事件//以下代码实现的是当DataGrid中所选用户改变时,根据所选用户重新设置ListBox的//功能for(int i=0;i< this.chkLst_Priority.Items.Count;i++)                                                 //将ListBox中所用权限设为未选中{    this.chkLst_Priority.SetItemChecked(ifalse);}int intRowNumber =this.dgrd_Popedom.CurrentCell.RowNumber;string selectedUserID =this.ds.Tables[0].Rows[intRowNumber][0].ToString();string tempStrSQL= "" select 权限名称 from 权限清单 "" + "" where 用户编号 = '"" +

selectedUserID + ""'"";
popedomDataTable=link.SelectDataBase(tempStrSQL); //查询所选用户权限
for(int i=0;i<popedomDataTable.Rows.Count;i++) //重新设置ListBox
{
for(int j=0;j<this.chkLst_Priority.Items.Count;j++)
{
if(this.chkLst_Priority.Items[j].ToString().Trim()==popedomDataTable.
Rows[i][0].ToString().Trim())
{
this.chkLst_Priority.SetItemChecked(jtrue);
}
}
}

blInitial=false;

}
}
}

解决方案

你可以在UpdateDataBase上面点右键,然后点转到定义。把UpdateDataBase的定义贴出来。

解决方案二:
UpdateDataBase这个方法在哪里定义的。你调用的参数和它需要的不匹配。

解决方案三:
this.link.UpdateDataBase(this.ds temSendStrSQL);
这样看看
或者

this.link.UpdateDataBase(this.ds 你的表名);

解决方案四:
具体怎么写最好贴出
UpdateDataBase
这个方法的实现。

感觉你是在拿一个人家的程序修改,你要搞清楚原来代码的含义再修改。

解决方案五:
UpdateDataBase方法传递的参数个数不对。

解决方案六:
UpdateDataBase 函数调用参数不对,查看一下定义

解决方案七:
public DataSet UpdateDataBase(DataSet changedDataSet string tableName)
怎样改啊?

解决方案八:
UpdateDataBase 你要传两个参数

时间: 2024-08-25 09:30:27

错误 1 “UpdateDataBase”方法没有任何重载采用“1”个参数的相关文章

“UpdateDataBase”方法没有任何重载采用“1”个参数

问题描述 "UpdateDataBase"方法没有任何重载采用"1"个参数 public DataSet UpdateDataBase(DataSet changedDataSet string tableName) { this.myConnection = new SqlConnection(connectionString); this.da = new SqlDataAdapter(this.strSQL this.myConnection); this.s

急求,各位前辈帮个忙,错误 “EndExecuteNonQuery”方法没有任何重载采用“0”个参数

问题描述 急求,各位前辈帮个忙,非常感谢!错误1"EndExecuteNonQuery"方法没有任何重载采用"0"个参数错误2"System.Web.UI.WebControls.DataListCommandEventArgs"不包含"FindControl"的定义,并且找不到可接受类型为"System.Web.UI.WebControls.DataListCommandEventArgs"的第一个参数的

为何它会显示“GetAll”方法没有任何重载采用 1 个参数

问题描述 为何它会显示"GetAll"方法没有任何重载采用 1 个参数 定义的时候是定义1个参数啊 本人初学者 程序卡在这边不知道要怎么办 解决方案 你的getall方法就不对. 你的返回值类型是 User 但是你 return users;返回的是 User[]. 你需要先修改getall方法,返回值修改为User[],它通过编译了,主程序自然就对了. 解决方案二: ToString"方法没有采用"1"个参数的重载

C# 编辑代码时提示错误:与其最匹配的重载方法具有一些无效参数

问题描述 C# 编辑代码时提示错误:与其最匹配的重载方法具有一些无效参数 方法: public void plusOne(ref int numX,ref int numY) { if(numY<8) { numY += 1; } else { numX = numX + 1; numY = 0; } } public void cel() { int num1=1; int num2=1; plusOne(num1,num2);//此处显示错误:与其最匹配的重载方法具有一些无效参数 } 解决方

svchost.exe应用程序错误的解决方法

svchost.exe应用程序错误的解决方法: svchost.exe是微软Windows操作系统中的一个系统程序,其微软官方对它的解释是:svchost.exe是从动态链接库(DLL)中运行的服务的通用主机进程名称.该程序对系统的正常运行起到了重中之重的作用,而且是不能被结束的. Svchost.exe在哪里? Svchost.exe文件存在于"%system root%system32"(如C:Windowssystem32)目录下,可以说是Windows 系统中核心的重要进程 ,

UCenter Home会员升级或搬家后404错误的排查方法

UCenter Home是http://www.aliyun.com/zixun/aggregation/12899.html">康盛创想(Comsenz)公司发布的一款SNS建站系统,自发布至今国内采用UCenter Home搭建的地方及垂直SNS已经超过15万家.本期教程就为大家解析会员升级或者搬家后再登录或者退出 UCenter Home 的时候有404的错误的排查方法,如下图所示 问题分析: 这个一般是由于 UCenter Home 的 config.php 文件中 UCenter

出现问题ContactsAdd没有采用“10”个参数的重载

问题描述 我是个菜鸟~在改其他人的程序~出现问题ContactsAdd没有采用"10"个参数的重载~我知道问题原因是要求参数个数与你传入个数不同不过我想不要那最后一个参数应该怎么改?privatevoidbutton10_Click(objectsender,EventArgse)//添加{if(textBox1.Text!=""&&comboBox1.Text!=""&&comboBox2.Text!="

centos6.5 编译安装lamp以及相关错误的解决方法_Linux

一.准备工作  1.安装编译工具gcc.gcc-c++ 注意解决依赖关系,推荐使用yum安装,若不能联网可使用安装光盘做为yum源-- 1)编辑yum配置文件: #mount /dev/cdrom /mnt/cdrom #vi /etc/yum.repos.d/CentOS-Media.repo [c5-media] name=CentOS-$releasever- Mediabaseurl=file:///mnt/cdrom   * 修改为光盘挂载点            file:///me

Oracle安装遇到INS-30131错误的解决方法_oracle

需要学习SDE配置相关知识,其中Oracle数据库安装遇到错误INS-30131,虽然未能最终解决,但找到了初步的思路,记录下来给大家提供参考.下文对很多知识的理解可能存在错误或不够精准,仅作参考. 软件:Oracle12cR1 版本:12.1.0.2 系统:win10 版本:10.0.10240 问题描述: 配置SDE需注意:数据库服务端应与SDE统一,数据库客户端应与ArcMap统一.安装数据库时遇到INS-30131错误,未能解决. 安装过程中先装数据库服务端,再装客户端. 其中11gR2