C#,ADO.NET和MS-SQL [英] C#, ADO.NET and MS-SQL

查看:55
本文介绍了C#,ADO.NET和MS-SQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


关于C#,ADO.NET和MS-SQL之间进程的问题


我需要了解复杂性使用分布式方法

(ADO.NET)的数据检索以及后续更新数据库与

关于交易。


EG - 库存商品采购订单。


标题:

Ledger,供应商,订单编号


详情:

商店,商品,数量,单位价格


页眉条目:

数据库:BeginTransaction

1.Enter /选择分类帐

在加载应用程序时在客户端存储所有分类帐详细信息



使用搜索表单,允许用户输入详细信息。使用读卡器

检索匹配的分类帐。

2.输入/选择/创建供应商

存储所有供应商详细信息 - 不实用?



使用搜索表单,允许用户输入详细信息。如果用户具有

适当的权限,则可以输入新的供应商。使用阅读器检索

匹配供应商。


详细输入:

基本上与商店和商品代码相同的主体


接受订单:

数据库:EndTransaction


似乎(对我而言)DBAdapter会很有用因为我需要

获取数据,因为用户输入/选择Ledger,Supplier,Store和

项目字段。我无法存储潜在的数据,因为我不知道将选择什么

(Ledger和Store字段可以存储,因为它们是b / b $ b $相当静态)


我应该使用自己的存储版本设计上述过程,而不是使用DBAdapter来设计
。如果是这样,我正在寻找一个实时系统,因为它与ADO.NET模型相关联($断开连接)


我希望我的问题不是清楚如泥。


Dougie

Hi All,

Question regarding the processes between C#, ADO.NET and MS-SQL

I need to understand the complexities of using the distributed method
(ADO.NET) of data retrieval and the subsequent update of database with
regard to transactions.

E.G. - Stock Item Purchase Order.

Header:
Ledger, Supplier, Order Number

Details:
Store, Item, Qty, UnitPrice

Header Entry:
database: BeginTransaction
1.Enter/Select Ledger
Store all ledger details on client when loading app
or
Use a search form, allowing the user to enter details. Use a Reader to
retrieve matching Ledgers.
2.Enter/Select/Create Supplier
Store all Supplier details - not practical?
or
Use search form, allowing user to enter details. If the user has the
proper authority, a new Supplier may be entered. Use reader to retrieve
matching Suppliers.

Detail Entry:
Basically the same principal for the Store and Item codes

Accept Order:
database: EndTransaction

It does not seem (to me) that the DBAdapter will be useful as I need to
obtain data as the user enters/selects the Ledger, Supplier, Store and
Item fields. I cannot store potential data because I have no idea what
will be selected (the Ledger and Store fields could be stored as they
are fairly static)

Should I design the above process by using my own version of storage and
not using the DBAdapter. If so, I am looking at a real-time system as
apposed to the ADO.NET model (disconnected)

I hope my question is not a clear as mud.

Dougie

推荐答案

好吧,也许不是泥但很多云。请不要错,这是错误的

方式,但如果我理解你,我会说你需要一个好的ADO.NET

书并且通过它来描述在UI上以非常规的方式与数据库交互

的整个过程。我不是故意要踌躇满志,但是有很多分,我不知道从哪里开始

回应。


例如
Well, maybe not mud but pretty cloudy. Please don''t take this the wrong
way, but if I''m understanding you I''d say you need to get a good ADO.NET
book and go through it, as you describe the whole process of interacting
with the database on a UI in a very unconventional way. I don''t mean to be
smug but there''s so many points I wouldn''t know where to start in
responding.

For example
对我来说,DBAdapter似乎没有用,因为我需要在用户输入/时获取数据选择Ledger,Supplier,Store和
Item字段。


有很多基于ADO.NET的应用程序可以做到这一点。


" DJ van Vliet" <做**** @ global.co.za>在消息中写道

news:cd ********** @ ctb-nnrp2.saix.net ...大家好,

有关流程的问题C#,ADO.NET和MS-SQL之间我需要了解使用分布式方法(ADO.NET)进行数据检索的复杂性以及后续的数据库更新/>关于交易。

EG - 库存商品采购订单。

标题:
Ledger,供应商,订单编号

详情:
商店,商品,数量,单位价格页眉条目:
数据库:BeginTransaction
1.输入/选择分类帐
在加载应用程序时将所有分类帐详细信息存储在客户端上

使用搜索表单,允许用户输入详细信息。使用阅读器来检索匹配的分类帐。
2.输入/选择/创建供应商
存储所有供应商详细信息 - 不实用?

使用搜索表单,允许用户输入详细信息。如果用户具有适当的权限,则可以输入新的供应商。使用阅读器检索匹配的供应商。

详细条目:
商店和商品代码基本相同的原则

接受订单:
数据库:EndTransaction

对于我来说,当用户输入/选择分类帐,供应商,商店和<时,我需要获取数据时,DBAdapter似乎没有用处。 br />项目字段。我无法存储潜在的数据,因为我不知道将选择什么(分类帐和商店字段可以存储,因为它们相当静态)

我应该设计上面的使用我自己的存储版本并且不使用DBAdapter进行处理。如果是这样的话,我正在看一个与ADO.NET模型相关的实时系统(断开连接)

我希望我的问题不是很清楚。

Dougie
It does not seem (to me) that the DBAdapter will be useful as I need to
obtain data as the user enters/selects the Ledger, Supplier, Store and
Item fields.
There''s a gazillion ADO.NET based applications that do that.

"DJ van Vliet" <do****@global.co.za> wrote in message
news:cd**********@ctb-nnrp2.saix.net... Hi All,

Question regarding the processes between C#, ADO.NET and MS-SQL

I need to understand the complexities of using the distributed method
(ADO.NET) of data retrieval and the subsequent update of database with
regard to transactions.

E.G. - Stock Item Purchase Order.

Header:
Ledger, Supplier, Order Number

Details:
Store, Item, Qty, UnitPrice

Header Entry:
database: BeginTransaction
1.Enter/Select Ledger
Store all ledger details on client when loading app
or
Use a search form, allowing the user to enter details. Use a Reader to
retrieve matching Ledgers.
2.Enter/Select/Create Supplier
Store all Supplier details - not practical?
or
Use search form, allowing user to enter details. If the user has the
proper authority, a new Supplier may be entered. Use reader to retrieve
matching Suppliers.

Detail Entry:
Basically the same principal for the Store and Item codes

Accept Order:
database: EndTransaction

It does not seem (to me) that the DBAdapter will be useful as I need to
obtain data as the user enters/selects the Ledger, Supplier, Store and
Item fields. I cannot store potential data because I have no idea what
will be selected (the Ledger and Store fields could be stored as they
are fairly static)

Should I design the above process by using my own version of storage and
not using the DBAdapter. If so, I am looking at a real-time system as
apposed to the ADO.NET model (disconnected)

I hope my question is not a clear as mud.

Dougie



感谢您的回复,


我有一份MS ADO.NET一步一步和Chris Sells''Windows表格

编程用C#


问题是所有这些书籍和文章都展示了一些

申请 - 例如包含查询的DataGrid或Combo / ListBox

表。如果有35,000条记录可以选择
,会发生什么?我不想带来所有记录。这意味着

在用户忙于捕获时与数据库进行交互式连接

- 不完全是分布式方法!


让我试着更好地解释一下。 (也许是一个简短的例子。)


用户需要新的采购订单。


已知:

布局订单标题,供应商是必需的,商品将被订购。


我需要在捕获新订单时建立DataAdapter / DataSet。

两个表 - 标题和详细信息。


标题:选择分类帐和供应商。

详细信息:商店和项目的选择

DataAdapter / DataSet是否可以使用Update,Insert

和Delete命令将更改提交回数据库?


丹尼尔比林斯利写道:
Thanks for the reply,

I have a copy of MS ADO.NET step by step and Chris Sells'' Windows forms
programming in C#

The problem is that all these books and articles show pieces of an
application - e.g. a DataGrid or a Combo/ListBox containing lookup
tables. What happens if there are 35,000 records that could be
selected? I do not want to bring all the records across. This means
interactive connection to the database while the user is busy capturing
- not exactly a distributed method!

Let me try and explain it better. (Maybe a short example.)

The user requires a new purchase order.

Known:
Layout of Order header, a supplier is required and Items will be ordered.

I need to build up a DataAdapter/DataSet as the new order is being captured.
Two tables - Header and Details.

Header: selection of Ledger and Supplier.
Details: selection of Store and Items

Will the DataAdapter/DataSet be in a position to use the Update, Insert
and Delete commands to commit changes back to the database?

Daniel Billingsley wrote:
好吧,也许不是泥但很多云。请不要以错误的方式采取这种方式,但如果我理解你,我会说你需要获得一本好的ADO.NET
书并按照你的描述进行操作。以非常规的方式在UI上与数据库进行交互的整个过程。我不是故意要自鸣得意,但是有很多要点,我不知道从哪里开始回复。

例如

Well, maybe not mud but pretty cloudy. Please don''t take this the wrong
way, but if I''m understanding you I''d say you need to get a good ADO.NET
book and go through it, as you describe the whole process of interacting
with the database on a UI in a very unconventional way. I don''t mean to be
smug but there''s so many points I wouldn''t know where to start in
responding.

For example

当我向用户输入/选择Ledger,Supplier,Store和时,我需要获取数据,因此DBAdapter似乎没有用处。
项目字段。
It does not seem (to me) that the DBAdapter will be useful as I need to
obtain data as the user enters/selects the Ledger, Supplier, Store and
Item fields.



有这么多基于ADO.NET的应用程序。

DJ van Vliet <做**** @ global.co.za>在消息中写道
新闻:cd ********** @ ctb-nnrp2.saix.net ...


There''s a gazillion ADO.NET based applications that do that.

"DJ van Vliet" <do****@global.co.za> wrote in message
news:cd**********@ctb-nnrp2.saix.net...

大家好,

有关C#,ADO.NET和MS-SQL之间进程的问题

我需要了解使用分布式方法(ADO.NET)进行数据检索的复杂性和关于交易的后续数据库更新。

EG - 库存商品采购订单。

标题:
Ledger,供应商,订单编号

详情:
商店,商品,数量,单位价格页眉条目:
数据库:BeginTransaction
1.输入/选择分类帐
在加载应用程序时将所有分类帐详细信息存储在客户端上

使用搜索表单,允许用户输入详细信息。使用阅读器来检索匹配的分类帐。
2.输入/选择/创建供应商
存储所有供应商详细信息 - 不实用?

使用搜索表单,允许用户输入详细信息。如果用户具有适当的权限,则可以输入新的供应商。使用阅读器检索匹配的供应商。

详细条目:
商店和商品代码基本相同的原则

接受订单:
数据库:EndTransaction

对于我来说,当用户输入/选择分类帐,供应商,商店和<时,我需要获取数据时,DBAdapter似乎没有用处。 br />项目字段。我无法存储潜在的数据,因为我不知道将选择什么(分类帐和商店字段可以存储,因为它们相当静态)

我应该设计上面的使用我自己的存储版本并且不使用DBAdapter进行处理。如果是这样的话,我正在看一个与ADO.NET模型相关的实时系统(断开连接)

我希望我的问题不是很清楚。

Dougie
Hi All,

Question regarding the processes between C#, ADO.NET and MS-SQL

I need to understand the complexities of using the distributed method
(ADO.NET) of data retrieval and the subsequent update of database with
regard to transactions.

E.G. - Stock Item Purchase Order.

Header:
Ledger, Supplier, Order Number

Details:
Store, Item, Qty, UnitPrice

Header Entry:
database: BeginTransaction
1.Enter/Select Ledger
Store all ledger details on client when loading app
or
Use a search form, allowing the user to enter details. Use a Reader to
retrieve matching Ledgers.
2.Enter/Select/Create Supplier
Store all Supplier details - not practical?
or
Use search form, allowing user to enter details. If the user has the
proper authority, a new Supplier may be entered. Use reader to retrieve
matching Suppliers.

Detail Entry:
Basically the same principal for the Store and Item codes

Accept Order:
database: EndTransaction

It does not seem (to me) that the DBAdapter will be useful as I need to
obtain data as the user enters/selects the Ledger, Supplier, Store and
Item fields. I cannot store potential data because I have no idea what
will be selected (the Ledger and Store fields could be stored as they
are fairly static)

Should I design the above process by using my own version of storage and
not using the DBAdapter. If so, I am looking at a real-time system as
apposed to the ADO.NET model (disconnected)

I hope my question is not a clear as mud.

Dougie




你好Dougie,


首先,一个事务应围绕数据库上的一组操作

,其中数据库将被更新。在下面的示例中,您将围绕阅读开始

交易。数据库和更新本地数据集...否

更新数据库。不要在

数据输入表格的开头开始交易!收集所有更改,将它们包装在一起,并立即提交

(DBAdapters对此有好处)。否则,使用小的

交易来保持数据库的一致性(例如添加供应商和

详细信息作为一个交易,并添加包含详细信息的订单)。


其次,我不知道您的应用程序有多大或多复杂,但是由于需要更多的可扩展性,通常会出现一些妥协:

1)在填写表格期间将较少的数据移至客户端。操作和

2)使客户端到服务器的消息更加完整(

意义上该消息将包含所需的所有信息

在到达服务器时插入,更新或删除记录。


在架构上,我会推荐以下内容:


1)不要向最终用户(浏览器客户端)下载任何填写表格所需的绝对数据。


2)提供比显示所有内容更受限制的搜索功能。善良

列表。例如。如果用户需要从10,000个供应商中进行选择,则允许

用户选择一小组默认用户。供应商或一套他们在今天工作的工作,或通过一个简单的类别或搜索来查询供应商

分类,这样他们就可以从中选择20左右。将结果集存储在

a DataSet中以方便使用,或者只是一个集合,无论什么对您有用。


3)允许用户在客户没有检查

凭证。如果用户没有权限,请在发布表单后回复错误

消息。 (a)他们不会两次犯错,

和(b)你花了很多时间解决人类不会面对的问题。 ..人们知道什么时候他们没有权利做某事。 YAGNI


4)你不应该试图预测数据。这将是愚蠢的。

只需允许用户输入与已知值匹配的数据(如

供应商代码)或查找供应商并选择一个使用。


5)你说的就像你想要真正的可扩展性(1000多个并发用户)。

如果是这种情况,请将中间件放在数据库服务器上。没有

ASP.NET Web服务器完全与ADO对话。让网络应用与数据库服务器上的中间件通信
。使用MSMQ或其他一些

异步机制进行通信。使用合作独立对象的概念(参见我的

文章:
http://www.ftponline.com/vsm/2004_06...ents/guestop/) 。如果你的并发用户少于100个,那么这个

就是+大规模的矫枉过正+。你只是

没有在你的留言中说。


我希望这会有所帮助,

--- Nick Malik

解决方案架构师,MCSD

" DJ van Vliet" <做**** @ global.co.za>在消息中写道

news:cd ********** @ ctb-nnrp2.saix.net ...
Hello Dougie,

First off, a transaction should surround a set of operations on a database
where the database would be updated. In the example below, you begin the
transaction around "reading" the database and updating a local dataset... no
updates to the database. Do NOT start the transaction at the beginning of a
data entry form! Collect all your changes, wrap them together, and submit
them at once (DBAdapters are good for this). Otherwise, use small
transactions that keep the database consistent (like adding a supplier and
details as one transaction, and adding an order with details as another).

Secondly, I don''t know how large or complex your application is, but as more
scalability is needed, a couple of compromises usually occur:
1) Move less data to the client during a "fill-out-the-form" operation, and
2) Make the message from the client to the server more complete (in the
sense that this message will contain all of the information that is needed
to either insert, update, or delete the records when it gets to the server).

Architecturally, I''d recommend the following:

1) Download nothing to the end user (browser client) that isn''t absolutely
necessary to fill out the form.

2) Provide a more restricted search capability than a "show everything" kind
of list. E.G. if the user needs to select from 10,000 suppliers, allow a
user to select a small set of "default" suppliers or a set that they are
working on "today", or to query on suppliers by a simple category or search
taxonomy, so that they can pick from only 20 or so. Store the result set in
a DataSet for convenience, or just a collection, whatever works for you.

3) Allow the user to create a supplier on the client without checking
credentials. If a user doesn''t have authority, respond with an error
message after they post the form. (a) they won''t make that mistake twice,
and (b) you are spending buckets of time solving a problem that humans don''t
face... people know when they don''t have the right to do something. YAGNI

4) You are right not to try to anticipate the data. That would be foolish.
Just allow the user to enter data that either matches a known value (like a
supplier code) or look up a supplier and select one to use.

5) You are talking like you want real scalability (1,000+ concurrent users).
If this is the case, place middleware on the database server. Don''t have
the ASP.NET web server talk to ADO at all. Have the web app communicate
with the middleware on the db server. Communicate using MSMQ or some other
async mechanism. Use the concept of cooperating independent objects (see my
article:
http://www.ftponline.com/vsm/2004_06...ents/guestop/). This
is +massive overkill+ if you have less than 100 concurrent users. You just
didn''t say in your message.

I hope this helps,
--- Nick Malik
Solutions Architect, MCSD
"DJ van Vliet" <do****@global.co.za> wrote in message
news:cd**********@ctb-nnrp2.saix.net...
大家好,

有关C#,ADO.NET和MS-SQL之间进程的问题

我需要了解使用分布式方法(ADO.NET)进行数据检索的复杂性和关于交易的后续数据库更新。

EG - 库存商品采购订单。

标题:
Ledger,供应商,订单编号

详情:
商店,商品,数量,单位价格页眉条目:
数据库:BeginTransaction
1.输入/选择分类帐
在加载应用程序时将所有分类帐详细信息存储在客户端上

使用搜索表单,允许用户输入详细信息。使用阅读器来检索匹配的分类帐。
2.输入/选择/创建供应商
存储所有供应商详细信息 - 不实用?

使用搜索表单,允许用户输入详细信息。如果用户具有适当的权限,则可以输入新的供应商。使用阅读器检索匹配的供应商。

详细条目:
商店和商品代码基本相同的原则

接受订单:
数据库:EndTransaction

对于我来说,当用户输入/选择分类帐,供应商,商店和<时,我需要获取数据时,DBAdapter似乎没有用处。 br />项目字段。我无法存储潜在的数据,因为我不知道将选择什么(分类帐和商店字段可以存储,因为它们相当静态)

我应该设计上面的使用我自己的存储版本并且不使用DBAdapter进行处理。如果是这样的话,我正在看一个与ADO.NET模型相关的实时系统(断开连接)

我希望我的问题不是很清楚。

Dougie
Hi All,

Question regarding the processes between C#, ADO.NET and MS-SQL

I need to understand the complexities of using the distributed method
(ADO.NET) of data retrieval and the subsequent update of database with
regard to transactions.

E.G. - Stock Item Purchase Order.

Header:
Ledger, Supplier, Order Number

Details:
Store, Item, Qty, UnitPrice

Header Entry:
database: BeginTransaction
1.Enter/Select Ledger
Store all ledger details on client when loading app
or
Use a search form, allowing the user to enter details. Use a Reader to
retrieve matching Ledgers.
2.Enter/Select/Create Supplier
Store all Supplier details - not practical?
or
Use search form, allowing user to enter details. If the user has the
proper authority, a new Supplier may be entered. Use reader to retrieve
matching Suppliers.

Detail Entry:
Basically the same principal for the Store and Item codes

Accept Order:
database: EndTransaction

It does not seem (to me) that the DBAdapter will be useful as I need to
obtain data as the user enters/selects the Ledger, Supplier, Store and
Item fields. I cannot store potential data because I have no idea what
will be selected (the Ledger and Store fields could be stored as they
are fairly static)

Should I design the above process by using my own version of storage and
not using the DBAdapter. If so, I am looking at a real-time system as
apposed to the ADO.NET model (disconnected)

I hope my question is not a clear as mud.

Dougie



这篇关于C#,ADO.NET和MS-SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆