問題タブ [dynamic-data-site]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
2 に答える
655 参照

c# - Adding "Export to XML" to Dynamic Data Site

Am working on a business layer for a complex web application and am temporary using the Dynamic Data Site functionality to allow data to be entered into the many tables that I need to maintain. I don't want to spend too much time on this DDS since the business layer needs to be finished first. Once the business layer is done, it gets shipped to someone else to add a better user interface.

However, while the DDS offers a lot of functionality in a very easy way, I just want to extend it with an "Export to XML" button or link. (And I'll probably will add an "Export to Excel" button later.)

So, has anyone done something like this already? What would be the easiest way to implement this in .NET, without rewriting the DDS?

(I use an Entity model for the database connection and much of the business layer is built upon this entity model. Once the business layer is finished, the real GUI interface will be developed for this web application but for now I just need a good way to input/output this data.)


I have no problems converting an entity set to XML. That's the easy part. My problem lies in expanding "ListDetails.aspx" with an additional button which the user can click. Once clicked, it should export the dataset to XML. To make it interesting, if the user has set one or more filters, it should only export those filtered records. I think I'll have to look into the "GridDataSource" object that's on this page and experiment with it. Will it return the whole table or just the filtered dataset? Or just the records that are on the current page?


Now, with export, I just want a dump of the dataset to XML. Basically, what you see should end up in the final XML. If I have access to the filtered dataset then creating the XML would be easy. (And creating the Excel sheet on top of that is a piece of cake too.) In general, the export is just used to help develop the business layer of a project I'm working on. Most of the code is business logic that will be used in other (web/desktop) client applications but while the project is still in progress, the DDS is needed for easier data entry for the project. Once it's finished (a gazillion years from now, I guess) then the DDS won't be used anymore. Nor would we use the XML exports or the export sheets. But for now, those exports are useful to evaluate the data. (Since I still have to develop the more complex analysis tools.)

0 投票する
4 に答える
3053 参照

c# - 'row_number' は認識された関数名ではありません。キーワード「AS」付近の構文が正しくありません

数十のテーブルと多数のインデックスを持つ SQL Server データベースを使用して単純なプロジェクトを作成しましたが、特に複雑なことは何もありません。トリガーも、ストアド プロシージャも、追加の「データベース マジック」もありません。コードは C# で書かれており、Entity モデルと Dynamic Data Site を使用して基本をすばやくセットアップするだけなので、タイピング モンキーを動かして基本的なデータ エントリを実行しながら、プロジェクトをより成熟するように変更します。 .

SQL Server 2005 でテストしたところ、すべて正常に動作しました。そこで、Visual Studio を使用してセットアップを行い、それを入力中の Monkeys とその管理者に送信しました。1) 新しいデータベースを作成します。2) データベースの Create スクリプトを実行します。3) 私が提供したセットアップをインストールします。4) 便宜上、特別な構成ファイルに配置されている接続文字列を変更します。5) Web インターフェイスを使用して、問題が発生した場合は通知してください。

そして、何かがうまくいかなかった。この完全なエラー:行 1: '(' 付近の構文が正しくありません。'row_number' は認識された関数名ではありません。キーワード 'AS' 付近の構文が正しくありません。

コードで「row_number」を使用していません。クエリにはLinqを使用しています。その上、エンティティ モデルのおかげで、SQL の処理についてあまり心配する必要さえありません。(私はそれが得意ですが。)

私の最初の推測は、彼らが間違った接続文字列を使用していることです。彼らはこのアプリケーションを SQL Server にインストールしている可能性があります (それでも動作するはずです) が、接続文字列を完全に変更していないため、私のプロジェクトは SQL Server 2005 を使用していると考えています。他の厄介なバグ?

完全なエラー:

[SqlException (0x80131904): 1 行目: '(' 付近の構文が正しくありません。'row_number' は認識される関数名ではありません。キーワード 'AS' 付近の構文が正しくありません。]
System.Data.SqlClient.SqlConnection.OnError(SqlException 例外、ブール値breakConnection) +1950890 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException 例外、Boolean breakConnection) +4846875 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior、 SqlCommand cmdHandler、SqlDataReader dataStream、BulkCopySimpleResultSet bulkCopyHandler、TdsParserStateObject stateObj) +2392
System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +33 System.Data.SqlClient.SqlDataReader.get_MetaData() +83 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +297
System.Data .SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +954 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +162
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior、RunBehavior runBehavior、Boolean returnStream、String メソッド) +32 System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior 動作、String メソッド) +141
System.Data.SqlClient.SqlCommand. ExecuteDbDataReader(CommandBehavior の動作) +12
System.Data.Common.DbCommand.ExecuteReader(CommandBehavior の動作) +10
System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand、CommandBehavior の動作) +387

[EntityCommandExecutionException: コマンド定義の実行中にエラーが発生しました。詳細については、内部例外を参照してください。]
System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior) +423
System.Data.Objects.Internal.ObjectQueryExecutionPlan.Execute(ObjectContext context, ObjectParameterCollection parameterValues) +743
System.Data. Objects.ObjectQuery 1.GetResults(Nullable1 forMergeOption) +157
System.Data.Objects.ObjectQuery`1.GetIListSourceListInternal() +13 System.Data.Objects.ObjectQuery.System.ComponentModel.IListSource.GetList() +7 System.Web.UI.WebControls.EntityDataSourceView.ExecuteSelect(DataSourceSelectArguments 引数、作成者qbConstructor) +1168 System.Web.UI.WebControls.EntityDataSourceView.ExecuteSelect(DataSourceSelectArguments 引数) +102
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments 引数、DataSourceViewSelectCallback コールバック) +19 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73 システム。 Web.UI.WebControls.GridView.DataBind() +4 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82 System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +72 System.Web.UI.Control .EnsureChildControls() +87 System.Web.UI.Control.PreRenderRecursiveInternal() +44 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI .Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842


このアプリケーションは、以前は SQL Server 2000 システム上に構築されていましたが、問題なく動作しました。ただし、テスト データベースは 2005 にアップグレードされましたが、本番データベースはまだ 2000 を使用しています。これで問題は発生しないはずですが、私の推測は正しいですか?

0 投票する
0 に答える
362 参照

asp.net - 動的データ サイトで外部キーの代わりにデータ列を表示する

asp.net 動的データ サイトを使用しています。すべてのテーブルの足場を有効にしました。また、外部キーも表示されます。テーブルからの外部キーの代わりにデータ列を表示したい。

このテーブル ItemsInProcess には Outlet テーブルの _OutletID が含まれています。Outlet テーブルの OutletName 列を表示したいと思います。

0 投票する
3 に答える
600 参照

asp.net - asp.net動的データで空の文字列がNULLになるのを防ぐ

標準の ASP.NET 4 動的データ サイトがあります (Linq to SQL を使用)。

私の SQL-Server データベースには、NOT NULL に設定されている数百の varchar フィールドがありますが、デフォルト値は空の文字列です。それらは決して NULL であってはなりませんが、内容として空の文字列を持つことができます。

動的データ サイトでこれらのフィールドを編集すると、内部ロジックはフィールドを NOT NULL と見なし、TextBox1.Text (空の文字列) と UPDATE SQL を呼び出して値を NULL に設定し、更新に失敗します。

System.Web.DynamicData.MetaColumn にはプロパティ 'ConvertEmptyStringToNull' がありますが、読み取り専用です。

何百ものフィールドすべてのプロパティを変更せずに、空の文字列が NULL になるのを防ぐにはどうすればよいですか?

0 投票する
1 に答える
347 参照

c# - Dynamic Data Web サイト - 親テーブルの値で子テーブルの行をフィルター処理する

Linq から SQL 動的データ サイトへのアプリケーションを作成しました。リレーショナル構造を持つテーブルがたくさんあります。例: tblSite、tblSiteImage、tblSiteAdvertisement、tblGenericCategory、tblEntityTypeなど。tblSiteは、他のすべてのテーブルの親テーブルです。これらすべてのテーブルにフィルター、つまり tblSite のフィルターを適用したいと思います。

つまり、tblSite データのドロップ ダウン リスト (DDL) が必要です。DDL からのデータの選択を変更した後、これらのテーブルからデータをフィルタリングする必要があります。

SiteId 列は tblGenericCategory などの一部のテーブルに存在しますが、テーブル tblEntityType には存在しないことに注意してください。ただし、これら 2 つのテーブルは、tblEntityType の EntityTypeId 列を使用して接続されています。

したがって、関係は次のようになります。

tblSite ------> tblGenericCategory ------> tblEntityType

テーブル tblEntityType に SiteId のフィルターを適用したい。

だから、私の質問はこれです:

Dynamic Data Site アプリケーションで子テーブルの子にフィルターを適用するにはどうすればよいですか?

前もって感謝します。

0 投票する
0 に答える
57 参照

asp.net - Url Rewriting データベースの値を動的に一致させる

Asp.net で動的 Web サイトの開発に成功しました。デフォルトの URL を次のように変更しました。

問題は、データベースに保存されている値に従って URL を動的に書き込みたいことです。たとえば、NewSurvey という値がある場合、URL を abc.com/NewSurvey のようにしたいのですが、このページからログイン ページに移動する必要があります。続行する方法についての提案.??
私は新しいro asp.netです。これに関するリンクをいただければ幸いです。よろしくお願いします。