.NET Logo
Welcome Guest Search | Active Topics | Members | Log In | Register

การพัฒนาระบบที่ใช้ SQLServer จะกำหนด connection string อย่างไร Options · View
areisv
Posted: Thursday, October 02, 2008 1:49:31 PM
Rank: มือฝึกหัด
Groups: Member

Joined: 10/2/2008
Posts: 5
Location: thai

สมมุติว่าในระบบที่พัฒนาด้วย Access จะมี connection string ที่เขียนที่เดียว เวลาคอมไพล์แล้ว จะนำไปติดตั้งเครื่องใหนก็ได้  แต่ ระบบที่พัฒนาโดยใช้ SQLServer เวลาผมเขียน ผมต้องอ้างอิง connection string เป็นชื่อเครื่องผม เวลาคอมไพล์แล้วรันในเครื่องผมได้ไม่มีปัญหา  แต่ถ้าไปรันเครื่องอื่นต้องไปแก้ใน connection string เป็นชื่อเครื่องนั้นๆ  ถึงจะรันได้  มีการแก้ไขปัญหาแบบนี้มั๊ยครับ  เขียนแบบให้เป็นแบบไดนามิกน่ะครับ

paedotnet
Posted: Thursday, October 02, 2008 6:01:10 PM

Rank: มือเทพ
Groups: Member

Joined: 12/6/2007
Posts: 354
Location: bkk

application เป็น website หรือ ว่า Window app ครับ

ถ้าเป็น window app ก็สร้าง Connection String ไว้ใน App.config ครับเวลาเรียกใช้ก็ไม่ต้องไปแก้ไขที่โค้ดภายใน โปรแกรม แค่ไปแก้ไขที่ไฟล์ App.config เท่านั้น

แต่ถ้าทำเป็น website ก็เขียนใน web.config ครับ



[With great power comes great responsibility]
areisv
Posted: Saturday, October 04, 2008 1:52:30 AM
Rank: มือฝึกหัด
Groups: Member

Joined: 10/2/2008
Posts: 5
Location: thai

สมมุติว่าจะสร้างฟอร์มในโปรแกรม  กำหนดช่องกำหนดค่าหรือเลือกค่าได้ ได้มั๊ย แทนการเปิด app.config ใน notepad แล้วพิมพ์เอง

Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.8 (NET v2.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.


Sponsored by