Home » Archive by category "SQL"

Archive for the 'SQL' Category

VB.NET – User Impersonation

Application Error: “ASP.NET  v4.0” does not have the authority to perform the requested command or operation.” Problem: ASP.NET  v4.0 application has no right to access DB2 database with default application user. Solution: Read more… Login on to server where your application is hosted Create new local user account (myuser, myusrpwd) Add myuser account to DB2ADMNS, […]

VB.NET – OleDbConnection Properties

Insert data using OleDbConnection Use ACE.OLEDB for databse connection (insert data) Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim con As New OleDbConnection(“Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Projects\Northwind.accdb;Persist Security Info=False”) Dim CmdStr As String = “insert into sample _ (emp_name,category,city) _ values (‘” & TextBox2.Text & “‘,_ ‘” & TextBox3.Text & “‘,_ ‘” & […]

Array – using array (vb.net) to update multiple records

‘Dim RecIDRE As String = Request.Form(“reId”) If Not RecID = 0 Then Try ‘define sql conn Dim connString As String connString = ConfigurationManager.ConnectionStrings(“MySQLConnectionString1”).ToString Dim conn As New SqlConnection(connString) Dim cmd As New SqlCommand() conn.ConnectionString = connString conn.Open() Dim printArray As Array = RecID.Split(“,”) Dim i As Integer For i = 0 To printArray.Length – 1 […]