错误 1 非静态的字段、方法或属性“WindowsFormsApplication1.DataOperate.getCom(string)”要求对象引用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.OleDb;
using System.Net;
using WindowsFormsApplication1;namespace WindowsFormsApplication1
{
public partial class FrmMain : Form
{
public FrmMain()
{
InitializeComponent();
} DataOperate dataoperate = new DataOperate();
DataSet ds; private void button1_Click(object sender, EventArgs e)
{
string myname = Dns.GetHostName();
IPHostEntry mys = Dns.GetHostEntry(myname);
this.textBox1.Text = mys.AddressList[0].ToString();
DataOperate.getCom("insert into xxb(ID,ZJMC,ip_address)values('" + textBox1.Text + "','" + textBox1.Text + "','" + textBox1.Text + "')"); }
}
}
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.OleDb;
using System.Net;
using WindowsFormsApplication1;namespace WindowsFormsApplication1
{
public partial class FrmMain : Form
{
public FrmMain()
{
InitializeComponent();
} DataOperate dataoperate = new DataOperate();
DataSet ds; private void button1_Click(object sender, EventArgs e)
{
string myname = Dns.GetHostName();
IPHostEntry mys = Dns.GetHostEntry(myname);
this.textBox1.Text = mys.AddressList[0].ToString();
DataOperate.getCom("insert into xxb(ID,ZJMC,ip_address)values('" + textBox1.Text + "','" + textBox1.Text + "','" + textBox1.Text + "')"); }
}
}
解决方案 »
- 很奇怪的错误"索引 -1 没有值。",难到是.net的bug?
- Winform刷新问题
- ^ō^ 继续提问! 如何获取方法(MethodInfo)内所有局部变量的信息?
- xmldocument.load 读一个XML文件的问题
- 如何把matlab中工具箱c原程序文件fis.c编译为dll文件,并在c#中调用
- 窗口中textBox不能输入中文,怎么回事?
- 怎样把一个字符串格式的时间赋给时间控件?
- 在线等....用过美萍视频点播系统的加QQ125572829
- 100分求书,C#.net
- 100分相送 如何在一个treeview中拖动时改变默认的光标??
- c#字符串切取问题?在线等.....
- ajax异步提交怎么保持aspx原有的样式?
DataOperate.getCom("insert into xxb(ID,ZJMC,ip_address)values('" + textBox1.Text + "','" + textBox1.Text + "','" + textBox1.Text + "')",conn);
去瞧瞧
有大小写区分