Home » Posts tagged "Visual Studio" (Page 2)

Archive for the 'Visual Studio' Tag

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 […]

Resize image before upload

Markup Page <div id=”FileUpd1″ runat=”server” > Default: <asp:FileUpload ID=”ImgUpload1″ runat=”server” /> <asp:Button ID=”Btn1″ runat=”server” Text=”Submit ” CssClass=”btnSubmit” CausesValidation=”true”/> Code Behind – Click to read more… Imports System.IO Imports System.Web.UI Imports System.Data.Sql Imports System.Data.SqlClient Imports System.Drawing Imports System.Drawing.Imaging Protected Sub Btn1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Btn1.Click ‘define variable Dim adPhotoName As String = […]

List Directory Content with Bulleted List Hyperlink – VB.NET

Code Behind Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) ‘ make a reference to a directory Dim DirPath As New IO.DirectoryInfo(“C:\\My_Website\My_Folder”) Dim FCollect As IO.FileInfo() = DirPath.GetFiles() Dim FInfo As IO.FileInfo ‘list the names of all files in the specified directory For Each FInfo In FCollect ‘bind url to line item – […]