SQL データベースから画像データを読み込もうとしています。私がする必要があるのは、それを読んでもらうことだけです。しかし、18行目の質問に記載されているエラーが表示されますか? 誰か助けてください。
コードは次のとおりです。
SQL データベースから画像データを読み込もうとしています。私がする必要があるのは、それを読んでもらうことだけです。しかし、18行目の質問に記載されているエラーが表示されますか? 誰か助けてください。
コードは次のとおりです。
RevisionConnectionString
web.config ファイルに名前が付けられた接続文字列がありますか?
web.config ファイルで、<configuration>
セクションに次を追加します。
<connectionStrings>
<add name="RevisionConnectionString" connectionString="whatever it should be for you;" />
</connectionStrings>
Property ConfigurationManager.ConnectionStrings
gets the ConnectionStringsSection
data for the current application's default configuration.
A ConnectionStringsSection
object contains the contents of the configuration file's connectionStrings section.
And configuration file is your web.config
, which means that in it you should have section where is stated conn string as a relation to data source.
So, first check is there a connection string, and if is, check is name written properly.
18行目はこれを示しています:
string strConnection = ConfigurationManager.ConnectionStrings["RevisionConnectionString"].ToString();
これは、キーを持つ ConnectionString がないことを意味するだけですRevisionConnectionString