以前はasp.net Webサイトでのみ動作していました。私は、ASP.NETのWebサイトでは、接続文字列がweb.configファイルにあることを知っています。VB.NETアプリケーション内の接続文字列
私の問題は、データベースに接続する必要のあるVB.NETアプリケーションで作業を開始したことです。どのように接続文字列が作成され、どこに配置する必要がありますか?
ありがとうございます!ここで
は全体のapp.configファイルです:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<connectionStrings>
<add name="dbAsthmaConnectionString" connectionString="Data Source=9300-00\SQLEXPRESS;Initial Catalog=dbStore;Persist Security Info=True;User ID=johnsmith;Password=1234" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.diagnostics>
<sources>
<!-- This section defines the logging configuration for My.Application.Log -->
<source name="DefaultSource" switchName="DefaultSwitch">
<listeners>
<add name="FileLog"/>
<!-- Uncomment the below section to write to the Application Event Log -->
<!--<add name="EventLog"/>-->
</listeners>
</source>
</sources>
<switches>
<add name="DefaultSwitch" value="Information" />
</switches>
<sharedListeners>
<add name="FileLog"
type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
initializeData="FileLogWriter"/>
<!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->
<!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
</sharedListeners>
</system.diagnostics>
</configuration>
ありがとう、テーブルアダプタを作成しようとしましたが、接続文字列が表示されませんでした。私は接続文字列を configuration>内に配置しました –
web.confgからセクション全体をコピー&ペーストするだけです。 –
app.configファイルのどのセクションに貼り付けますか?、などがあります。 –