Dim chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" Dim random = New Random() Dim result = New String(Enumerable.Repeat(chars, 5).[Select](Function(s) s(random.[Next](s.Length))).ToArray()) 'TextBox1.Text = result.ToString() Dim flag As Integer = 0 Dim con As SqlConnection = New SqlConnection("Initial Catalog = ibs;Data Source = localhost;Persist Security Info=True;Integrated Security = True;") con.Open() Dim cmd As SqlCommand = New SqlCommand("insert into t1 values ('" + result + "','" + flag + "')", con) Dim i As Integer = cmd.ExecuteNonQuery() If i > 0 Then Response.Write("<script LANGUAGE='JavaScript'>alert('" + result + "')</script>") End If
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)