只尝试贴一小部分程式码
因为全部也贴不上来= =
程式码跟执行档都超过2mb的限制...
有需要再去原站下载吧
/////////////////////////////////////////////////////////////处理演员关联插入///////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////处理演员关联插入///////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////处理演员关联插入///////////////////////////////////////////////////////////////////////////
System::String ^演员textbox="";
relation=false; //true就是已经有一样的资料false就是还没有
nextID;
this->sctemp=this->textBox2->Text; //存放演员字串8--Actor在textbox2
scmp="";
index=0;
for(int c=0; c<sctemp->Length; c++)
{
if(sctemp!=',')
{
scmp=scmp->Insert(index,sctemp.ToString());
index++;
}
else
{
rcmd=rodc->CreateCommand();
rcmd->CommandText="SELECT * FROM Actor";
rread=rcmd->ExecuteReader();
while(rread->Read())
{
if(System::String::Compare(scmp,rread->GetValue(1)->ToString())==0) {演员textbox+=rread->GetValue(0)->ToString(); relation=true; break;} else relation=false;
}
if(relation==false)
{
rcmd=rodc->CreateCommand();
rcmd->CommandText="SELECT COUNT(*) FROM Actor";
rread=rcmd->ExecuteReader();
rread->Read();
nextID=System::Convert::ToInt32(rread->GetValue(0));
nextID++;
rcmd=rodc->CreateCommand();
rcmd->CommandText="INSERT INTO Actor (ID,演员) VALUES ("+nextID+","+"\""+scmp+"\""+")";
int change=rcmd->ExecuteNonQuery();
演员textbox=System::String::Concat(演员textbox,nextID.ToString());
}
scmp="";
index=0;
演员textbox+=",";
}
}
rcmd=rodc->CreateCommand();
rcmd->CommandText="SELECT * FROM Actor";
rread=rcmd->ExecuteReader();
while(rread->Read())
{
if(System::String::Compare(scmp,rread->GetValue(1)->ToString())==0) {演员textbox+=rread->GetValue(0)->ToString(); relation=true; break;} else relation=false;
}
if(relation==false)
{
rcmd=rodc->CreateCommand();
rcmd->CommandText="SELECT COUNT(*) FROM Actor";
rread=rcmd->ExecuteReader();
rread->Read();
nextID=System::Convert::ToInt32(rread->GetValue(0));
..
访客只能看到部份内容,免费 加入会员 或由脸书 Google 可以看到全部内容