数据库插入和更新 [英] database insertion and updation

查看:58
本文介绍了数据库插入和更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我正在asp.net中开发一个应用程序,我在其中发送带有id的多个号码,作为回应,我按顺序发送了msgid和id,我已发送。



现在我想在sqldatabase中存储数字,msgid。怎么办呢????

Hi i am developing an application in asp.net in which i am sending multiple numbers with id and in response i get msgid and id in sequential order that i hv sent.

Now i want to store the number, msgid in sqldatabase. How can it b done????

推荐答案

谷歌是你的朋友。



这是一个清单资源 [ ^ ]将按照您的要求回答问题。
Google is your friend.

Here is a list of resources[^] that will answer the question as you have asked it.


您好





我正在向发件人发送请求,多个号码和ID说

每个请求的发件人相同



发件人,电话号码,身份证



A,9999,1

A,8888,2

A,7777,3



当我收到每个号码的msgID时请求。响应只包含msgID和我在请求中发送的ID说



msgID,ID

ABC,1(第一个数字) )

DEF,2(第二个数字)

GHI,3(第3个数字)



现在我在SQl有一张桌子如下



数字

msgID

ID



我想在这个表中存储数字和相应的msgID。如何以最好的方式实现。

我的问题是万一发生问题说在dat特定时间msg ID没有生成或更新未成功,另一个请求被激发,具有相同的发件人ID和数字,因此相应的数据应该更新而不是所有数据。







我发送以下请求。



发件人,编号,ID



A,9999,1

A,8888,2

A ,7777,3



并且更新失败但msgID是gnerated和用户发送另一个请求说



发件人,号码,ID



A,9999,1 1

A,8888,2

A,6666,3



in这种情况下会生成msgID,它将如何更新obnlly dis记录而不是之前发送的previos记录。
Hi


I am sending a request with sender, multiple numbers and ID say
Sender is same for each request

sender, number, ID

A, 9999, 1
A, 8888, 2
A, 7777, 3

For ths request when I get a msgID against each number. The response contains only the msgID and the ID I hav send in the request say

msgID, ID
ABC, 1 (for 1st number)
DEF, 2 (for 2nd number)
G 3 (for 3rd number)

Now I have a table in SQl as below

Number
msgID
ID

I want to store the number and the corresponding msgID in this table.How can dis b achieved with best possible way.
My prob is in case a issue occur say at dat particular time msg ID is not genarated or the updation was not successful and another request is fired with the same sender ID and numbers so the corresponding data shoul get updated not all the data .

Say

I am sending the below req.

sender, number, ID

A, 9999, 1
A, 8888, 2
A, 7777, 3

and the updation fails but the msgID is gnerated and user sent another request say

sender, number, ID

A, 9999, 1
A, 8888, 2
A, 6666, 3

and in this case msgID is generated, den how it will update obnlly dis record not the previos one that was sent earlier.


这篇关于数据库插入和更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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