-2

SQL データベースから画像データを読み込もうとしています。私がする必要があるのは、それを読んでもらうことだけです。しかし、18行目の質問に記載されているエラーが表示されますか? 誰か助けてください。

コードは次のとおりです。

http://codepad.org/d3Yd702T

4

3 に答える 3

2

RevisionConnectionStringweb.config ファイルに名前が付けられた接続文字列がありますか?

web.config ファイルで、<configuration>セクションに次を追加します。

<connectionStrings>
    <add name="RevisionConnectionString" connectionString="whatever it should be for you;" />
</connectionStrings>
于 2013-02-21T16:53:50.707 に答える
1

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.

于 2013-02-21T17:02:50.300 に答える
0

18行目はこれを示しています:

string strConnection = ConfigurationManager.ConnectionStrings["RevisionConnectionString"].ToString();

これは、キーを持つ ConnectionString がないことを意味するだけですRevisionConnectionString

于 2013-02-21T16:55:46.733 に答える