问题:
当我点击图书管理信息时候会出现图书信息管理的框,在这个框里TEXT中如何显示图书信息查看中dataGridView的值给图书信息管理中的text中?菜鸟求助大虾们!帮帮偶。代码如下
use master
go
create database Book
go
use Book
create table bookInfo
(
BookID bigint identity(1,1) primary key,
BookType varchar(50) not null,
BookName varchar(100) not null,
BookPrice smallmoney not null,
BookPic varchar(200),
BookContent text not null
)select * from bookInfoinsert into bookInfo values('计算机','c#bible','30.0000','D:\ss\','小伙子这书很重要')VS代码:
private void button2_Click(object sender, EventArgs e)
{
bookGl b = new bookGl(); b.Show();
this.Hide();
}
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
int index = e.RowIndex;
if (index >= 0)
{
string tid = this.dataGridView1.Rows[index].Cells[0].Value.ToString();
string type = this.dataGridView1.Rows[index].Cells[1].Value.ToString();
string name = this.dataGridView1.Rows[index].Cells[2].Value.ToString();
string price= this.dataGridView1.Rows[index].Cells[3].Value.ToString();
string pic= this.dataGridView1.Rows[index].Cells[4].Value.ToString();
string content = this.dataGridView1.Rows[index].Cells[5].Value.ToString();
}
}
{
textboxl.text=dataGridView1[0, e.RowIndex].Value.ToString();
textbox2.text=dataGridView1[1, e.RowIndex].Value.ToString();
//./.............
}