Code:
try
{
//connect
}
catch
{
//exception
}
finally
{
GC.Collect();
}
try
{
//connect
}
catch
{
//exception
}
finally
{
GC.Collect();
}
public class code
{
public int RD { get; set; }
}
public class CodeProgram
{
public static void main()
{
code cd = new code();
cd.RD=1;
Console.Write{"{0}",cd.RD);
}
}
try
{
//connect
}
catch
{
//exception
}
finally
{
//disconnect
}
using System;
using System.IO;
public class tst
{
public static void main(string[] args)
{
FileStream fl1 = null;
FileStream fl2 = null;
try {
fl1 = file.OpenRead("myfile1.txt");
Console.WriteLine("fl1 open");
//i think you forgot to put a double quote at line 46.. String s = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\folder\\sub folder\\sub folder\\sub folder\\yourDB.mdb"; //and maybe you can use the @ to scape all characters you want to scape?. //like this.. String s = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\folder\sub folder\sub folder\sub folder\yourDB.mdb";
rs.Requery do until rs.eof if rs!name="your desired name of picture" then frmMain.PictureBox1.Picture = LoadPicture(app.path & "/" & rs!Pic_path) 'ex: your app path 'is in drive d: 'folder prog1 'this will be 'D:/prog1/images/pic1.bmp exit sub else rs.movenext end if loop
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
/*void variable doesnt return anything, thats why we need to use the parameters*/
void printMenu(int a, int b) {
printf("you entered %d
and %d",a,b);
}
int main()
{
char choice;
int n1,n2;
printf("enter choice:\n");
scanf("%c",&choice);
'testing.. :) 'under general declarations Dim arr1(),arr2(),arr3() As String Dim i,n As Integer 'let rs handles the recordset 'sub to get records then add to a listbox rs.Requery n = rs.RecordCount Redim arr1(1 To n) Redim arr2(1 To n) Redim arr3(1 To n) i = 1 Do Until rs.Eof arr1(i) = rs!ID arr2(i) = rs!Name
'maybe try this..
'General Declaration
Dim StrCountry(),StrCity() As String
'FormLoad
Redim StrCountry(1)
Redim StrCity(1)
StrCountry() = {"U.S.","France"}
StrCity() = {"Washington","Paris"}
For i = 0 To UBound(StrCountry())
List1.Add StrCountry(i)
Next i
'Listbox Click
Text1.Text = StrCity(List1.SelectedIndex)
Set rsStock = New ADODB.Recordset rsStock.Open "select * from your_table",Your_Active_Connection,adOpenStatic,adLockOptimistic rsStock.Requery
Leave a comment: