Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

vbnet programatically convert type to db type

using Microsoft.SqlServer.Server; // SqlDataRecord and SqlMetaData
using System;
using System.Collections; // IEnumerator and IEnumerable
using System.Collections.Generic; // general IEnumerable and IEnumerator
using System.Data; // DataTable and SqlDataType
using System.Data.SqlClient; // SqlConnection, SqlCommand, and SqlParameter
using System.Web.UI.WebControls; // for Parameters.Convert... functions

private static SqlDbType TypeToSqlDbType(Type t) {
    DbType dbtc = Parameters.ConvertTypeCodeToDbType(t.GetTypeCodeImpl());
    SqlParameter sp = new SqlParameter();
    // DbParameter dp = new DbParameter();
    // dp.DbType = dbtc;
    sp.DbType = dbtc;
    return sp.SqlDbType;
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: how to show error xtramessagebox in devexpress c# 
Csharp :: razor: show editable list 
Csharp :: c# codebehind Append div 
Csharp :: cancellationtoken.linkedtokensource c# example 
Csharp :: c# boundingbox text 
Html :: fevicon 
Html :: html 5 default code 
Html :: link js to html 
Html :: enter key vue 
Html :: jquery ui cdn 
Html :: bootstrap css cdn 
Html :: fa link 
Html :: textarea placeholder css 
Html :: html input float type 
Html :: center vertically and horizontally bootstrap 4 
Html :: svg content_type 
Html :: add favicon html 
Html :: bootstrap large modal 
Html :: how to link to an email in html 
Html :: svg circle 
Html :: how to move all html files from one directory to other using python 
Html :: html space between characters 
Html :: how to add a title picture in html 
Html :: target blank rel 
Html :: textarea readonly 
Html :: nbsp in html 
Html :: html link para descargar archivo de audio 
Html :: View HTML5 Video on iOS devices without going to full screen 
Html :: centralizing to the middle of the screen with bootstrap 5 
Html :: how to make a button not reload on click 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =