-- 获取锁
ALTER procedure [dbo].[pro_get_sys_ordr_lock_info](
@ORDR_HEAD_SEQ 编号,
@ORDR_TYP_CD VARCHAR(20)
)as
begin
-- 获取锁
ALTER procedure [dbo].[pro_get_sys_ordr_lock_info](
@ORDR_HEAD_SEQ 编号,
@ORDR_TYP_CD VARCHAR(20)
)as
begin
.Net WinForm代码:
/// <summary>
/// 将DataGridViewRows转换为DataTable数据
/// </summary>
/// <param name="Listrows">DataGridView的行集合</param>
/// <param name="dtSource">源数据表</param>
/// <param name="colum">映射关系</param>
/// <param name="dtDestination">目的数据表</param>
/// <returns>返回新的DataTable</returns>
public static DataTable Getdatatable(DataGridViewRowCollection Listrows, DataTable dtSource, string[,] colum, DataTable dtDestination)
{
// string[,] colum = { { "id1", "id2" }, { "name1", "name2" } }; //colum是源DataGridViewRow到目标DataRow的映射关系
DataTable dtNew = dtSource.Clone();//复制表结构
foreach (DataGridViewRow dgvr in Listrows)
{
DataRow dataRow = (dgvr.DataBoundItem as DataRowView).Row; //转换成数据行DataRow
dtNew.ImportRow(dataRow); //添加DataRow到DataTable
}
string[] copy = new string[colum.Length / 2];
for (int i = 0; i < colum.Length / 2; i++)
{
copy[i] = colum[i, 0]; //获取源数据要的列
}
DataTable dtNew2 = dtNew.DefaultView.ToTable(false, copy);//复制源表结构和数据,并只保留copy数据中的列
if (dtDestination != null)
{
for (int j = 0; j < dtNew2.Rows.Count; j++)
{
DataRow row = dtDestination.NewRow();
for (int f = 0; f < colum.Length / 2; f++)
{
row[colum[f, 1]] = dtNew2.Rows[j][colum[f, 0]]; //将源表中每行的各列数据复制到对应的目的表的行中
}
dtDestination.Rows.Add(row); //添加到目的表
}
}
return dtDestination;
}set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
/*****************************************************
** PROCEDURE : pro_set_so_cust_info
** DECRIPTION: 维护客户资料信息
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
/*****************************************************
** PROCEDURE : pro_get_so_cust_list
** DECRIPTION: 获取客户列表
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
/*****************************************************
** PROCEDURE : pro_is_so_cust_nam_show_repeat
** DECRIPTION: 判断客户用户和或显示名称是否重复
需求:不能每加一条数据就操作数据库,要完成所有的数据加入界面,点击保存时才一次性保存。
描述:
学校领导在大学生培养计划的制订中,涉及到课程的安排问题,由于课程较多,现在要求编程高手的你帮忙。假定课程之间的先修关系已确定,现在要求你根据先修关系,通过编程确定各门课程的先后关系,并生成一张课程先后安排顺序表,以帮助学校设置各年度课程。
输入:
输入只包括一个测试用例,第一行为一个自然数n,表示课程数量,第二行为n个单词,分别表示n门课程,一个单词表示一门课程,单词全为小写状态,各单词之间用一个空格隔开。
接下来为n*n行0和1构成的矩阵,表示各门课程之间的先修关系。假设i行j列为1,表示第i课程为第j课程的先修课。否则表示不存在先修关系。
#include<iostream.h> //这个代码很简单,这里只要知道在VC 6.0里面,要用这个头文件,不然编译通不过
//#include<iostream>
//using namespace std;
class IP
{
public:
IP(int i=0,int j=0,int k=0,int m=0)
{
i=a;
j=b;
k=c;
m=d;
}
friend istream& operator >> (istream &input,IP &h);
friend ostream& operator << (ostream &output,IP &h);
void print()
{
printt(a);
cout<<".";
printt(b);
cout<<".";
printt(c);
cout<<".";
printt(d);
cout<<'/n';
}
void printt(int a)
{
int b=128;
for(int i=1;i<=8;i++) //转换为八位二进制数
{
cout<<a/b;
a=a%b;
b=b/2;
}
}
private:
int a;
int b;
int c;
int d;
};
istream& operator >> (istream &input,IP &h)
{
input>>h.a;
input.ignore(); //读掉“.”
input>>h.b;
input.ignore(); //读掉“.”
input>>h.c;
input.ignore(); //读掉“.”
input>>h.d;
return input;
}
ostream& operator << (ostream& output,IP &h)
{
h.print(); //调用print() 函数,也可以在这里直接调用类中成员输出
return output;
}
int main()
{
IP ip;
cin>>ip;
cout<<ip;
return 0;
}.Net WinForm Code:
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.Threading;
namespace BackgroundWorkerSample
{
public partial class CalculateAddForm : Form
{
protected BackgroundWorker backgroundWorker1 = new BackgroundWorker();
//private int numberToCompute = 0;
//private int highestPercentageReached = 0;
public CalculateAddForm()
{
InitializeComponent();
InitializeBackgoundWorker();
}
// Set up the BackgroundWorker object by
// attaching event handlers.
private void InitializeBackgoundWorker()
{
this.backgroundWorker1.WorkerReportsProgress = true;
this.backgroundWorker1.WorkerSupportsCancellation = true;
this.backgroundWorker1.DoWork += new DoWorkEventHandler(backgroundWorker1_DoWork);
this.backgroundWorker1.ProgressChanged += new ProgressChangedEventHandler(backgroundWorker1_ProgressChanged);
this.backgroundWorker1.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker1_RunWorkerCompleted);
}
private long ComputeAdd(int n, BackgroundWorker worker, DoWorkEventArgs e)
<div id="testdiv" class="demo" style="width:200px;height:150px;border-width:1px;border-style:solid;border-color:Blue;">
...
Powered By Z-BlogPHP 1.7.5
Copyright 2024-2029 pukuimin Rights Reserved.
粤ICP备17100155号-1