ebrahimv
یک شنبه 10 بهمن 1389, 15:31 عصر
من يه كوري بزورگ دارم حال ميخوام اين كوري رو به ساده ترين روش بنويسم در قسمت كد
tblAvarezNosazeTableAdapter.Adapter.InsertCommand. CommandText = "INSERT INTO tblAvarezNosaze " +
" (NMomaize, Sal, Onvan, NeshaneMalke, Address, KodPoste, MasahatZamin, MasahatAiane, ArzeshZamin, ArzeshAiane, ArzeshTajhizat, AvarezMotafarega," +
"KhoshHPrint, JarimePrint, BadahePishin, KasrHazar, DarsadMohasbe, KodComputer, MohlatPardakht, MablagGPardakht, ShanaseGabz, ShanasePardakht," +
"DatePardakht, KhoshBadH, DatePrint, DateS, PaiamKh, AvarzSal, ChContorol, ChPcontrol, Note, Paiam, MablagGPardakhtH)" +
"VALUES (@NMomaize,@Sal,@Onvan,@NeshaneMalke,@Address,@Kod Poste,@MasahatZamin,@MasahatAiane,@ArzeshZamin,@Ar zeshAiane,@ArzeshTajhizat,@AvarezMotafarega,@Khosh HPrint,@JarimePrint,@BadahePishin,@KasrHazar,@Dars adMohasbe,@KodComputer,@MohlatPardakht,@MablagGPar dakht,@ShanaseGabz,@ShanasePardakht,@DatePardakht, @KhoshBadH,@DatePrint,@DateS,@PaiamKh,@AvarzSal,@C hContorol,@ChPcontrol,@Note,@Paiam,@MablagGPardakh tH) " + vbCrLf +
"INSERT INTO tblAvarezNosazeJephe (Sal, NMomaize, Number, Jephe, PoshtJ, DJaphe, DPoshtJ, Street, Gimat) " +
"SELECT @Sal AS Sal, tblMomaizeJephe.NMomaize, tblMomaizeJephe.Number, tblMomaizeJephe.Jephe, tblMomaizeJephe.PoshtJ, tblMomaizeJephe.DJaphe,tblMomaizeJephe.DPoshtJ, tblMomaizeJephe.Street, derivedtbl_1.Price AS Gimat " +
"FROM tblMomaizeJephe LEFT OUTER JOIN (SELECT Street, Price, Sal FROM tblAvarazNPStreet WHERE (Sal = @Sal)) AS derivedtbl_1 ON tblMomaizeJephe.Street = derivedtbl_1.Street WHERE (tblMomaizeJephe.NMomaize = @NMomaize)"
من از اين روش استفاده كردم كه خيلي دردسر داره و با كوچكترين اشتباه كار نميكنه
من دنبال يه امكاني ميگردم كه اين متن كوري رو درون اون بنويس و بعد از اون متن استفاده كنم
آيا همچين امكاناني هست؟
tblAvarezNosazeTableAdapter.Adapter.InsertCommand. CommandText = "INSERT INTO tblAvarezNosaze " +
" (NMomaize, Sal, Onvan, NeshaneMalke, Address, KodPoste, MasahatZamin, MasahatAiane, ArzeshZamin, ArzeshAiane, ArzeshTajhizat, AvarezMotafarega," +
"KhoshHPrint, JarimePrint, BadahePishin, KasrHazar, DarsadMohasbe, KodComputer, MohlatPardakht, MablagGPardakht, ShanaseGabz, ShanasePardakht," +
"DatePardakht, KhoshBadH, DatePrint, DateS, PaiamKh, AvarzSal, ChContorol, ChPcontrol, Note, Paiam, MablagGPardakhtH)" +
"VALUES (@NMomaize,@Sal,@Onvan,@NeshaneMalke,@Address,@Kod Poste,@MasahatZamin,@MasahatAiane,@ArzeshZamin,@Ar zeshAiane,@ArzeshTajhizat,@AvarezMotafarega,@Khosh HPrint,@JarimePrint,@BadahePishin,@KasrHazar,@Dars adMohasbe,@KodComputer,@MohlatPardakht,@MablagGPar dakht,@ShanaseGabz,@ShanasePardakht,@DatePardakht, @KhoshBadH,@DatePrint,@DateS,@PaiamKh,@AvarzSal,@C hContorol,@ChPcontrol,@Note,@Paiam,@MablagGPardakh tH) " + vbCrLf +
"INSERT INTO tblAvarezNosazeJephe (Sal, NMomaize, Number, Jephe, PoshtJ, DJaphe, DPoshtJ, Street, Gimat) " +
"SELECT @Sal AS Sal, tblMomaizeJephe.NMomaize, tblMomaizeJephe.Number, tblMomaizeJephe.Jephe, tblMomaizeJephe.PoshtJ, tblMomaizeJephe.DJaphe,tblMomaizeJephe.DPoshtJ, tblMomaizeJephe.Street, derivedtbl_1.Price AS Gimat " +
"FROM tblMomaizeJephe LEFT OUTER JOIN (SELECT Street, Price, Sal FROM tblAvarazNPStreet WHERE (Sal = @Sal)) AS derivedtbl_1 ON tblMomaizeJephe.Street = derivedtbl_1.Street WHERE (tblMomaizeJephe.NMomaize = @NMomaize)"
من از اين روش استفاده كردم كه خيلي دردسر داره و با كوچكترين اشتباه كار نميكنه
من دنبال يه امكاني ميگردم كه اين متن كوري رو درون اون بنويس و بعد از اون متن استفاده كنم
آيا همچين امكاناني هست؟