使用C#获取从下拉列表中选择的SQL Server列的数据类型 [英] Get data type of a SQL Server column selected from dropdown using C#

查看:239
本文介绍了使用C#获取从下拉列表中选择的SQL Server列的数据类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我需要使用C#确定从SQL Server数据库的下拉列表中选择的列的类型。



我的问题是

如何获取下拉列表值并从SQL服务器确定其datatye



如何实现场景

帮我一些例子或伪代码

请帮助







问候

Priyanka


I need to determine the type of a column selected from dropdown list from a SQL Server database using C#.

my question is
How to fetch the dropdownlist value and determine its datatye from SQL server

how to implement the scenario
help me with some examples or pseudo code
Please Help



Regards
Priyanka

推荐答案

尝试:

Try:
SELECT column_name, data_type, is_nullable, character_maximum_length FROM information_schema.COLUMNS WHERE table_name='myTable'

这篇关于使用C#获取从下拉列表中选择的SQL Server列的数据类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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