检索数据库表架构

编程入门 行业动态 更新时间:2024-10-28 03:29:26
本文介绍了检索数据库表架构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我最近一直在创建一个应用程序,我需要一些有关数据库表模式的帮助.我已使用mysql数据库在vb 3.5中对应用程序进行了编程. 应用程序的作用不是很重要……除了我试图获取数据库中表的模式.迄今为止,我在数据库中获取表的模式的方式如下

I have been creating an application recently and I need some help on database table schemas. I have programmed the application in vb 3.5 using a mysql database. What the application does is not really important… except that I am trying to get the schema for a table in the database. To date the way I have been getting the schema for a table in the database is as follows

Dim conn As New MySqlConnection(ConnString) ‘ConnString is defined elsewhere conn.Open() Dim cmd As MySqlCommand = conn.CreateCommand cmd.CommandText = "SELECT * FROM widgets WHERE widgetID=1" ‘Create a datareader and execute it Dim dr As MySqlDataReader dr = cmd.ExecuteReader() ‘Create a datatable to put the schema into Dim dtSchema As New DataTable dtSchema = dr.GetSchemaTable

我正在寻找一种无需执行select命令即可获取上表架构的方法.这将有助于我寻求使我的应用程序与多个数据库提供商一起使用.我不希望我的应用程序有任何SQL命令. (我的意图是仅使用数据库中的存储过程) 感谢所有帮助

I am seeking a way of getting the schema for the table above without having to execute the select command. This will help me in my quest to make my app work with more than one DB provider. I don’t want my app to have any SQL commands if at all possible. (my intention is to only use stored procedures in the database) Any help is appreciated

推荐答案

此 [ ^ ]文章将帮助您入门. This[^] article will help you get started.

更多推荐

检索数据库表架构

本文发布于:2023-07-14 13:40:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1104794.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:架构   数据库

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!