Laploy Web Board
Would you like to react to this message? Create an account in a few clicks or log in to continue.

เขียน Code ของ Web App ยังไงให้แสดงรูปใน Crystal Report จาก File Path ในฐานข้อมูล

2 posters

Go down

เขียน Code ของ Web App ยังไงให้แสดงรูปใน Crystal Report จาก File Path ในฐานข้อมูล Empty เขียน Code ของ Web App ยังไงให้แสดงรูปใน Crystal Report จาก File Path ในฐานข้อมูล

ตั้งหัวข้อ  decha 16th December 2010, 12:13 am


เรียนอาจารย์ ผมติดตามผลงาน หนังสือทั้ง 2 เล่ม เป็นหนังสือที่ดีมาก
ผมได้ใช้ประโยชน์จากหนังสือคุ้มค่าไม่เสียดายเงิน ไม่ว่าจะเป็นใช้ในการทำงานและการเรียน
ขอบคุณจริงๆ ครับสำหรับความรู้ ทั้งในหนังสือและบทความบนเว็บ
และกำลังเก็บตังไปเรียนกับอาจารย์ เรียนกับผู้รู้ 1 วันเท่ากับศึกษาเอง 100 วัน ฮ่าๆๆ

ตัวอย่างของ Win App
http://greatfriends.biz/webboards/msg.asp?id=64774

ปัญหาคือ Application.StartupPath ใน WebApp ใช้งานไม่ได้
อาจารย์ช่วยเขียน แบบ WebApp ให้เป็นแนวทาง

มือใหม่ ครับ


decha

จำนวนข้อความ : 7
Join date : 15/12/2010

ขึ้นไปข้างบน Go down

เขียน Code ของ Web App ยังไงให้แสดงรูปใน Crystal Report จาก File Path ในฐานข้อมูล Empty ลองแบบนี้

ตั้งหัวข้อ  Admin 16th December 2010, 11:45 am

ลองแบบนี้แล้วยังครับ

//get the full location of the assembly with DaoTests in it
string fullPath = System.Reflection.Assembly.GetAssembly(typeof(DaoTests)).Location;

//get the folder that's in
string theDirectory = Path.GetDirectoryName( fullPath );

Admin
Admin

จำนวนข้อความ : 215
Join date : 17/12/2009

http://laploy.forumotion.com

ขึ้นไปข้างบน Go down

เขียน Code ของ Web App ยังไงให้แสดงรูปใน Crystal Report จาก File Path ในฐานข้อมูล Empty Re: เขียน Code ของ Web App ยังไงให้แสดงรูปใน Crystal Report จาก File Path ในฐานข้อมูล

ตั้งหัวข้อ  decha 16th December 2010, 2:31 pm

//get the full location of the assembly with DaoTests in it
string fullPath = System.Reflection.Assembly.GetAssembly(typeof(DaoTests)).Location;

//get the folder that's in
string theDirectory = Path.GetDirectoryName( fullPath );


DaoTests มันคืออะไรครับ

แล้วจะใส่ sdr["PhotoPath"].ToString(); ตรงไหนครับ


decha

จำนวนข้อความ : 7
Join date : 15/12/2010

ขึ้นไปข้างบน Go down

เขียน Code ของ Web App ยังไงให้แสดงรูปใน Crystal Report จาก File Path ในฐานข้อมูล Empty เอาใหม่

ตั้งหัวข้อ  Admin 16th December 2010, 2:58 pm

ลอง

string myPath = Application.ExecutablePath();
หรือ
string myPath = Application.StartupPath();
หรือ
string myPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location))


Admin
Admin

จำนวนข้อความ : 215
Join date : 17/12/2009

http://laploy.forumotion.com

ขึ้นไปข้างบน Go down

เขียน Code ของ Web App ยังไงให้แสดงรูปใน Crystal Report จาก File Path ในฐานข้อมูล Empty Re: เขียน Code ของ Web App ยังไงให้แสดงรูปใน Crystal Report จาก File Path ในฐานข้อมูล

ตั้งหัวข้อ  decha 16th December 2010, 4:01 pm

ขอบคุณมากครับอาจารย์

ผมลืมบอกไปว่าเก็บ Folder งานไว้ที่ wwwroot แล้ว Run ผ่าน IIS
เลยใช้
string myPath = Server.MapPath(sdr["PhotoPath"].ToString());
Very Happy


decha

จำนวนข้อความ : 7
Join date : 15/12/2010

ขึ้นไปข้างบน Go down

ขึ้นไปข้างบน

- Similar topics

 
Permissions in this forum:
คุณไม่สามารถพิมพ์ตอบ