(
@ DATE DATETIME
)
RETURNS SMALLDATETIME
RETURN CAST ( CONVERT (varchar , @ DATE, 103 ) AS DATETIME )
END
(
@ DATE DATETIME
)
RETURNS SMALLDATETIME
RETURN CAST ( CONVERT (varchar , @ DATE, 103 ) AS DATETIME )
END
CREATE PROCEDURE SP_COLUMNAS_TABLA
@ TABLE VARCHAR (20 )
AS
BEGIN
- Create a temporary table which stores NAMES OF THE COLUMNS AND CHOOSE ALIAS FOR EACH TABLE
DECLARE @ TABLA_COLUMNAS TABLE (COLUMN varchar ( 50 ) DESCRIPTION varchar (50 ))
SET NOCOUNT ON
DECLARE @COLUMNA AS VARCHAR ( 50 )
DECLARE @ARRAY_COL AS NVARCHAR ( 500 )
DECLARE @DESCRIPCION AS VARCHAR ( 50 )
DECLARE @ ARRAY_DES AS NVARCHAR (500 )
IF @ TABLE = 'PEOPLE' BEGIN
SET @ ARRAY_COL = 'COD_PERSONA, NAME, FECHA_NACIMIENTO, '- NAMES OF THE COLUMNS IN THE TABLE1 WE WANT FILTER IN THE SEARCH, THIS BOARD MIGHT HAVE oviously more columns, JUST SELECT WE WANT THE SHOW
SET @ ARRAY_DES = 'CODE, NAME, DATE OF BIRTH,' - ALIAS COLUMN IN ORDER FOR THE NAME OF THIS FORM DESCRIBE THE TIME TO SHOW IN A FORM OF CONTROL
END
IF @ TABLA = 'CIUDADES' BEGIN
SET @ARRAY_COL = '
SET @ARRAY_DES = 'CODE, NAME,'
END
- you can even choose more columns in a table consultation
IF @ TABLE = 'CIUDAD_PERSONAS' BEGIN
SET @ ARRAY_COL = 'CIUDADES.NOMBRE , PERSONAS.NOMBRE '
SET @ ARRAY_DES = ' CITY, PERSON, '
END
WHILE LEN ( @ARRAY_COL ) <> 0
BEGIN
SET @COLUMNA = SUBSTRING ( @ARRAY_COL , 0 , CHARINDEX ( ',' , @ARRAY_COL ))
SET @ARRAY_COL = SUBSTRING ( @ARRAY_COL , CHARINDEX ( ',' , @ARRAY_COL , 0 )+ 1 , LEN ( @ARRAY_COL ))
SET @DESCRIPCION = SUBSTRING ( @ARRAY_DES , 0 , CHARINDEX ( ',' , @ARRAY_DES ))
SET @ARRAY_DES = SUBSTRING ( @ARRAY_DES , CHARINDEX ( ',' , @ARRAY_DES , 0 )+ 1 , LEN ( @ARRAY_DES ))
INSERT INTO @TABLA VALUES ( @COLUMNA , @DESCRIPCION )
END
SELECT * FROM @
END
Private Sub Btn_Aceptar_Click ( ByVal sender As System.Object, ByVal e As System.EventArgs ) Handles Btn_Aceptar.Click
Const RutaCockie As String = "C: \\ cockie.txt"
If ChkRecordar.Checked = True Then 'activate the check if we save the data file texo
Dim sw As New System.IO.StreamWriter (RutaCockie)
sw.WriteLine (Txt_NomUsu.Text)
sw.WriteLine (Txt_ClaUsu.Text) 'well you have no doubt the key coded or otherwise any cat could investigate the Cockies curious and watch the absurdity of your password: porsiempretuyo123
sw.Close ()
Else
If IO.File.Exists (RutaCockie) Then
My . Computer.FileSystem.DeleteFile (RutaCockie) 'I recommend you delete the file if you have saved before and now regret oz to it first if the file comprobareis existeis
End If
End If
End Sub
Private Sub Form1_Load( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase .Load
Const RutaCockie As String = "C: \\ cockie.txt" 'may be another route, curse you desire, all the rights of free expression will take shelter
If IO.File.Exists (RutaCockie) Then 'if file exists, it means that guardastes coockie data in each line and read the text data
ChkRecordar.Checked = True
Dim sr As New System.IO.StreamReader (RutaCockie, True )
sr.ReadLine Txt_NomUsu.Text = 'read the first line where I would be the name user in that order because it should've saved
Txt_ClaUsu.Text = sr.ReadLine 'Leea the second line
sr.Close ()
End If
End Sub
Dim filepath As String
'If the folder where we want to keep our files not created, because they believe, what we as
If Not Directory.Exists ( "C: \\ FTP" ) Then
Directory.CreateDirectory ( "C: \\ FTP" )
End If
filepath = "c : \\ FTP Files \\ archivodescargado.doc "
'important, it is necessary to check if the file already exists to open or run (if that's your intention) directly and not send another Once the download request FTP server
If Not File.Exists (filepath) Then
Try
DescargarArchivoFTP (filepath, "archivodescargado.doc" ) 'Click here for the procedure in which the file download
Catch ex As Exception
MsgBox(ex.Message)
Exit Sub
End Try
End If
End If
Try
System.Diagnostics.Process.Start (filepath) 'if your intension is to open the file oejecutar
GrabarEstado ()
Catch ex As Exception
MsgBox (ex.Message)
End Try