top
logo

ចំនួនអ្នកទស្សនា

033088
Today108
Yesterday115
This Week349
This Month923
All Days33088
38.107.191.87
US


លេខទូរស័ព្ទសង្គ្រោះបន្ទាន់ មន្ទីរពេទ្យសាធារណៈនៅភ្នំពេញ
d

១. រថយន្តសាមុយ មន្ទីរពេទ្យ​កាល់ម៉ែត= 119
២. រថយន្តសង្គ្រោះ មន្ទីរពេទ្យ​រុស្ស៊ី= 023 217 764
= វិទ្យុទាក់ទង (151940)
៣. រថយន្តសង្គ្រោះ មន្ទីរពេទ្យ​ព្រះសង្ឃ= 016 909 774
៤. លេខប្រចាំការ (Hot Line) គ្រុនផ្ដាសាយ A(H1N1)= 012 488 981
= 012 836 868

Programming
Save image to SQL Server បោះពុម្ភ  សារអេឡិចត្រូនិច
សរសេរដោយ Satya MAO   
អង្គារ, 23 មិនា 2010 14:43
Form

ដំបូងនៅក្នុង SQL Server ត្រូវបង្កើត Database មួយ​(ក្នុងឧទាហរណ៌គឺ database ឈ្មោះ TSQLFundamentals2008)
និងបន្ទាប់មកបង្កើត Table មួយដែលមាន Field ពីរគឺ ID (int), Picture (image) ។
Imports System.Data.SqlClient
Imports System.IO
Public Class Form1

   Dim op As New OpenFileDialog
   Private Sub Button1_Click(----------------------------) Handles Button1.Click
    Dim con As New SqlConnection
    con.ConnectionString = "Data Source=SATYA-PC\SQLEXPRESS;Initial Catalog=TSQLFundamentals2008;" & _
                               "Integrated Security=false;uid=mylogin;password=1"
    con.Open()
    Dim da As New SqlDataAdapter
    Dim fs As New FileStream(op.FileName, FileMode.Open, FileAccess.Read)
    Dim br As New BinaryReader(fs)
    br.BaseStream.Position = 0

    da.InsertCommand = con.CreateCommand
    da.InsertCommand.CommandText = "Insert into table_1 values(@id,@im)"
    da.InsertCommand.Parameters.AddWithValue("@id", TextBox1.Text)
    da.InsertCommand.Parameters.Add("@im", SqlDbType.Image).Value = br.ReadBytes(CInt(br.BaseStream.Length))
    da.InsertCommand.ExecuteNonQuery()
    con.Close()
   End Sub

   Private Sub Button2_Click(------------------------) Handles Button2.Click

    If op.ShowDialog = Windows.Forms.DialogResult.OK Then
        PictureBox1.ImageLocation = op.FileName
    End If
   End Sub
End Class
LAST_UPDATED2
 
Export Data from VB 6 to Microsoft Excel PDF  សារអេឡិចត្រូនិច
សរសេរដោយ Administrator   
សុក្រ, 25 ធ្នូ 2009 14:12
ជាដំបូង​អនុវត្តតាមការណែនាំខាងក្រោម៖
  • បង្កើត Form មួយដែលមានឈ្មោះ Form1 ជាឧទាហរណ៍
  • យក ListView Control មកគូសលើ Form1
    • ផ្ដល់តម្លៃឱ្យ Property lvwReport ជា View
    • បង្កើតជួរឈរ 5 ក្នុង ListView ដែលមានឈ្មោះរៀង ID, Name, Gender, Phone និង Address
  • គូសប៊ូតុងចំនួនពីរដោយដាក់ឈ្មោះរៀង btnExport និង btnClose
  1. On Event Form Load: ដាក់ទិន្នន័យចូលក្នុង ListView ចំនួន ១០ ជួរដេក

    Private Sub Form_Load()

        Me.lvwData.View = lvwReport

        '

        Dim i As Integer

       

        For i = 1 To 10

            With Me.lvwData.ListItems.Add(, , i)

                .SubItems(1) = "Name " & i

                .SubItems(2) = "M"

                .SubItems(3) = "012"

                .SubItems(4) = "Phnom Penh"

            End With

        Next

    End Sub
  2. On btnExport Click: ចុចប៊ូតុង btnExport ដើម្បីបញ្ជូនទិន្នន័យក្នុង List ទៅ Excel

    Private Sub cmdExport_Click()

        Dim ExcelApp As Object, ExcelBook As Object

        Dim ExcelSheet As Object

        Dim i As Integer

        Dim j As Integer

        Dim rowCount As Integer

        'create object of excel

        Set ExcelApp = CreateObject("Excel.Application")

        Set ExcelBook = ExcelApp.WorkBooks.Add

        Set ExcelSheet = ExcelBook.WorkSheets(1)

        '

        With ExcelSheet

            For i = 1 To Me.lvwData.ListItems.Count

                '

                rowCount = rowCount + 1

                .cells(rowCount, 1) = lvwData.ListItems(i).Text

                For j = 1 To lvwData.ColumnHeaders.Count - 1

                    .cells(rowCount, j + 1) = lvwData.ListItems(i).SubItems(j)

                Next

            Next

        End With

      

        ExcelApp.Visible = True

        'set page margin

        ExcelSheet.PageSetup.PaperSize = 9

        ExcelSheet.PageSetup.LeftMargin = ExcelApp.InchesToPoints(0.3)

        ExcelSheet.PageSetup.RightMargin = ExcelApp.InchesToPoints(0.3)

        ExcelSheet.PageSetup.TopMargin = ExcelApp.InchesToPoints(0.3)

        ExcelSheet.PageSetup.BottomMargin = ExcelApp.InchesToPoints(0.3)

        ExcelSheet.PageSetup.CenterHorizontally = True

        '

        Set ExcelSheet = Nothing

        Set ExcelBook = Nothing

        Set ExcelApp = Nothing

    End Sub

Download Source Code

 
ការបង្កើតនាឡិកាក្នុង Turbo C and C++ បោះពុម្ភ  សារអេឡិចត្រូនិច
សរសេរដោយ Setha IECH   
សុក្រ, 28 សីហា 2009 17:28
                  /****************************/
                  /*          CLOCK           */
                  /****************************/
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<math.h>
#include<stdlib.h>
#include<dos.h>
#define PI 3.141593
#define R 170
#define sc setcolor
char *month[]={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
void Box(int x,int y,int x1,int y1,int width,int color,int color1)
     {int i;
     for(i=0;i<width;i++)
          {sc(color);line(x+i,y+i,x+i,y1-i);line(x+i,y+i,x1-i,y+i);
          sc(color1);line(x+i,y1-i,x1-i,y1-i);line(x1-i,y+i,x1-i,y1-i);}
     }
 
void main(){int gd=DETECT,gm,midx,midy,i;
      initgraph(&gd,&gm,"C:\\TC\\BGI");
      midx=getmaxx()/2;
      midy=getmaxy()/2;
      setbkcolor(0);      sc(15);
      setfillstyle(1,10); fillellipse( midx , midy , 207 , 207 );
      setfillstyle(1,7);  fillellipse( midx , midy , 200 , 200 );
     for(i=0;i<12;i++)  pieslice( midx , midy , i*30 , (i+1)*30 , 200 );
      sc(7);       fillellipse( midx , midy , 185  , 185 );
      settextstyle( TRIPLEX_FONT , HORIZ_DIR , 1 );
      char ss[90];int P,Q;
     for(i=1;i<=12;i++){ sc(1); sprintf(ss,"%d",i);
      if(i==5)     { P=10 ; Q=-10; }
      else if(i==6){ P=20 ; Q=-5; }
      else if(i==4)  Q=-10;
      else if(i==7){ P=7  ; Q=5; }
      else         { P=0  ; Q=0; }//show number
      outtextxy( midx+185*sin(PI*30*i/180)+Q , midy-P-185*cos(PI*30*i/180) , ss);}
     while(!kbhit()){
            settextstyle( TRIPLEX_FONT , HORIZ_DIR , 1 );
            sc( 9 );outtextxy( midx-52 , midy-132 , "CLOCK" );
            struct dosdate_t date;  _dos_getdate(&date);
            sprintf( ss , "%d" , date.year );
            sc(15); outtextxy( midx-20 , 5 , ss );//show year
            settextstyle( 0 , 0 , 1 ); sc( 4 );
            sprintf( ss , "%d %s" ,date.day,month[date.month-1] );
            outtextxy( 297 , midy-150 , ss );//show date
            sc(12); outtextxy( midx-15 , midy+150 , "RUPP" );
            Box( midx-26 , midy-156 , midx+26 , midy-140 , 1 , 8 , 15 );
            //box of date
            struct dostime_t t; _dos_gettime(&t);
            if(t.hour>12)t.hour=t.hour-12;
            sprintf( ss,"%02d:%02d:%02d",t.hour,t.minute,t.second );
            setfillstyle(1,7);bar( midx+160 , midy-9 , midx+177 , midy+9 );

...................................បន្តទៀត --> ទាញយក​កូដទាំងមូល​ទីនេះ

 
ការបង្កើត​ប្រតិទិនសុរិយគតិ​ក្នុង Turbo C and C++ បោះពុម្ភ  សារអេឡិចត្រូនិច
សរសេរដោយ Setha IECH   
អង្គារ, 18 សីហា 2009 21:51
               /*         CALENDAR         */
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <string.h>
#include <dos.h>
 
#define  gt  gotoxy
#define  tc  textcolor
#define  tb  textbackground
 
struct dosdate_t date ;
 
/*Function shows current time*/
void cur_time()
{
      char *mer = (char *)malloc(2*sizeof(char)) ;
      while( !kbhit() ){
          struct dostime_t t ;
            _dos_gettime(&t) ;
      gt (28,21) ; tb( 0 )   ; tc(15) ;
      if (t.hour<12) mer = "AM" ;
      else strcpy (mer,"PM")    ;
      if (t.hour>12) t.hour = t.hour - 12 ;
      cprintf (" Current Time: %d:%02d:%02d  %s",t.hour,t.minute,t.second,mer) ;
      }
}
 
void public_day() ;
      //****************** main ******************
void main(){
      /*Declare the name of day*/
      char *day[] = {"Sun","Mon","Tue","Wed","Thu","Fri","Sat"} ;
      /*Declare the name of month*/
      char *month[] = {"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct",
                       "Nov","Dec"} ;
      char ca[]="Calendar of year" ;
      /*declare how many day per month*/
      long tdm[] = {31,28,31,30,31,30,31,31,30,31,30,31} ;
      long year,i,j,n,T,Startday,color,k=0,ch,endday,to,lastday ;
      tb(0)  ; window(0,0,80,25) ; clrscr() ; tc(15) ;
      gt(16,5) ; cprintf(" This program is show calendar of each years") ;

​     

      ...................................បន្តទៀត --> ទាញយក​កូដទាំងមូល​ទីនេះ

 

 
« ចាប់ផ្តើមទៅក្រោយ12345បន្ទាប់ទៀតចប់ »

ទំព័រ 5 នៃ 5

bottom
top
bottom

ផលិតដោយ krookroo.com.