[ASP.NET] Create a tablejudgment data table for the Oracle database already exists

xiaoxiao2021-03-06  39

Oracle database table created for: Dim myConnectionString As String Dim myConnection As OleDbConnection Dim myCommand As OleDbCommand Dim myCreateSQL As String myConnectionString = "Provider = 'OraOLEDB.Oracle.1'; User ID = [User ID]; Data Source = [Data Source] ; Extended Properties =; Persist Security Info = True; Password = [Password] "myConnection = New OleDbConnection (myConnectionString) myCreateSQL =" create table (abc varchar2 (10)) "myCommand = New OleDbCommand (myCreateSQL)

Whether myCommand.Connection = myConnection myConnection.Open () myCommand.ExecuteNonQuery () myCommand.Connection.Close () determination data table already exists: 'DataBaseName - table Private Function SQLExistDatabase (ByVal DataBaseName As String) As Boolean Dim orcConnDb As OracleConnection Dim Strselect AS String Dim OdaexistDatabase As OracleDataAdapter Dim DsexistDatabase As New DataSet

OrcConndb = new oracleconnection = "data source = [data source];" _ & "persist security info = false;" _ & "user id = [] user ID; password = [password];" OrcConndb.open )

STRSELECT = "SELECT Count (*) from user_tables where table_name = '" & repeateen (databasename) & "'" odaexistDatabase = new OracleDataAdapter (strSelect, OrcConndb)

OdaexistDatabase.fill (DsexistDatabase)

IF dsexistDatabase.tables (0). ROWS (0) (0) = 0 Then OrcConndb.close () Return False else OrcConndb.close () Return True End if End Function 'lowercase English translation to uppercase English word' ENSTRING - String Private function replaceen (Byval Enstring AS String) AS STRING DIM I AS INTEGERFOR I = ASC ("a") to ASC ("Z") Enstring = EnString.Replace (Cchar (CHRW (i)), Cchar (Chrw (i - 32))] Next

RETURN ENSTRING END FUNCTION Note: The ucase function in the ASP.NET is actually a way to convert lowercase English words into uppercase

转载请注明原文地址:https://www.9cbs.com/read-72933.html

New Post(0)