只嘗試貼一小部分程式碼
因為全部也貼不上來= =
程式碼跟執行檔都超過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 可以看到全部內容