⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 填充datagrid.txt

📁 数据库常用的一些操作方法代码
💻 TXT
字号:
			//Open Connection. 
			SqlConnection con = new SqlConnection("server=glf;uid=sa;pwd=;database=northwind");

			//Set the DataAdapter's query.
			da = new SqlDataAdapter("select * from customers", con);
			ds = new DataSet();

			//Fill the DataSet.
			da.Fill(ds, "customers");

			//Set the source table.
			dtSource = ds.Tables["customers"];
			//
			// Set the start and max records. 
			//pageSize = Convert.ToInt32(txtPageSize.Text);
			pageSize=20;
			maxRec = dtSource.Rows.Count;
			PageCount = maxRec / pageSize;

			//Adjust the page number if the last page contains a partial page.
			if ((maxRec % pageSize) > 0) 
			{
				PageCount += 1;
			}

			// Initial seeings
			currentPage = 1;
			recNo = 0;

			// Display the content of the current page.
			LoadPage();

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -