如何通过VB.NET 2010在每3行之后在mdb数据表中插入字符串 [英] How to insert string in mdb data tabel after each 3 rows via VB.NET 2010

查看:84
本文介绍了如何通过VB.NET 2010在每3行之后在mdb数据表中插入字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好先生

我有客户数据表。我想在每3行后插入xyz字符串请帮忙。我该怎么办。



我的尝试:



i是尝试使用for循环而不是成功

hello sir
I have customer data table. i want insert xyz string after each 3 rows please help. How can i do .

What I have tried:

i was try using for loop but not sucess

推荐答案

不要。这听起来像是一个演示功能,不应该与数据库相关。

问题是数据库是流动的对象:在大多数应用程序中添加,更改和删除行很多,这意味着你的三行和一个不同的数据突然开始变成四行,然后两行,然后是两行不同,然后......很快。

并且......除非您的数据库只有一列 - 这是一个文本字符串 - 它无论如何都无法工作,因为你不能在表格中混合列类型。如果它确实有一列,那么它也不会起作用,因为每行需要不同!

如果您需要这类报告或类似的东西,请在你的演示代码,而不是DB中的实时。
Don't. That sounds like a presentation function, and should not be database related.
The problem is that databases are fluid objects: rows are added, changed, and removed a lot in most applications, and that means that your "three rows and a different one" data suddenly starts to become "four rows, then two rows, then two different ones together, then..." very quickly.
And...unless your DB has just one column - which is a text string - it isn't going to work anyway, as you can't "mix" columns types in a table. And if it does have the one column, then that isn't going to work either, as each row needs to be different!
If you need this kind of thing for reporting or similar, do it in your presentation code, not "live" in the DB.


这篇关于如何通过VB.NET 2010在每3行之后在mdb数据表中插入字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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