Click here to Skip to main content
15,907,231 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionspecifying autocad version when opened by my vb application Pin
OlaMohammed8-May-08 10:21
OlaMohammed8-May-08 10:21 
AnswerRe: specifying autocad version when opened by my vb application Pin
Dave Kreskowiak8-May-08 10:31
mveDave Kreskowiak8-May-08 10:31 
GeneralRe: specifying autocad version when opened by my vb application Pin
OlaMohammed10-May-08 3:07
OlaMohammed10-May-08 3:07 
Questionsql server Pin
bapu28898-May-08 9:52
bapu28898-May-08 9:52 
AnswerRe: sql server Pin
Dave Kreskowiak8-May-08 10:20
mveDave Kreskowiak8-May-08 10:20 
QuestionRe: sql server Pin
bapu28899-May-08 9:01
bapu28899-May-08 9:01 
AnswerRe: sql server Pin
Dave Kreskowiak9-May-08 13:54
mveDave Kreskowiak9-May-08 13:54 
QuestionRe: sql server Pin
bapu288910-May-08 7:29
bapu288910-May-08 7:29 
hello sir

thanks for your rep.

this is the code i am using

and as you said that load the data in to dataset so i am loading data in loaddata sub but still i dont know what's wrong there

Private Sub LoadImages()<br />
       dsImage.Clear()        :confused:<br />
       Try<br />
           conImage = GetDBConnection()<br />
           daImage.Fill(dsImage.Images)        :confused:<br />
           If Me.BindingContext(dsImage.Images).Count = 0 Then<br />
               Label1.Text = "Empty Database"<br />
           Else<br />
               Label1.Text = Me.BindingContext(dsImage.Images).Count.ToString & " - Image(s) in database"<br />
           End If<br />
       Catch ex As Exception<br />
           MsgBox(ex.Message)<br />
       End Try<br />
       conImage.Close()<br />
       conImage.Dispose()<br />
   End Sub



and code for save image

Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click<br />
        Dim fs As FileStream = New FileStream(mImageFilePath.ToString(), FileMode.Open)<br />
        Dim img As Byte() = New Byte(fs.Length) {}<br />
        fs.Read(img, 0, fs.Length)<br />
        fs.Close()<br />
<br />
        mImageFile = Image.FromFile(mImageFilePath.ToString())<br />
        Dim imgHeight As Integer = mImageFile.Height<br />
        Dim imgWidth As Integer = mImageFile.Width<br />
        Dim imgLength As Integer = mImageFile.PropertyItems.Length<br />
        Dim imgType As String = Path.GetExtension(mImageFilePath)<br />
        mImageFile = Nothing<br />
        'get sql connection<br />
        conImage = GetDBConnection()<br />
        Dim sSQL As String = "INSERT INTO Images (Pic,Title, IType, Height, Width) VALUES(" & _<br />
                       "@pic, @title, @itype, @iheight, @iwidth)"<br />
        commImage = New Data.SqlClient.SqlCommand(sSQL, conImage)<br />
        ' image content<br />
        Dim pic As SqlParameter = New SqlParameter("@pic", SqlDbType.Image)<br />
        pic.Value = img<br />
        commImage.Parameters.Add(pic)<br />
<br />
        ' title<br />
        Dim title As SqlParameter = New SqlParameter("@title", System.Data.SqlDbType.VarChar, 50)<br />
        title.Value = txtTitle.Text.ToString()<br />
        commImage.Parameters.Add(title)<br />
<br />
        ' type<br />
        Dim itype As SqlParameter = New SqlParameter("@itype", System.Data.SqlDbType.Char, 4)<br />
        itype.Value = imgType.ToString()<br />
        commImage.Parameters.Add(itype)<br />
<br />
        ' height<br />
        Dim iheight As SqlParameter = New SqlParameter("@iheight", System.Data.SqlDbType.Int)<br />
        iheight.Value = imgHeight<br />
        commImage.Parameters.Add(iheight)<br />
<br />
        ' width<br />
        Dim iwidth As SqlParameter = New SqlParameter("@iwidth", System.Data.SqlDbType.Int)<br />
        iwidth.Value = imgWidth<br />
        commImage.Parameters.Add(iwidth)<br />
     <br />
        Try<br />
            commImage.ExecuteNonQuery()<br />
            MessageBox.Show("Image successfuly saved in database", "Image Load")<br />
        Catch ex As Exception<br />
            MsgBox(ex.Message)<br />
<br />
        End Try<br />
        commImage.Dispose()<br />
        commImage = Nothing<br />
        conImage.Close()<br />
        conImage.Dispose()<br />
        Call LoadImages()<br />
    End Sub


any help Confused | :confused:

and i have drag and drop sqlcomand, sqladapter objects on form

waiting for your kind rep.

have a nice day
AnswerRe: sql server Pin
Dave Kreskowiak10-May-08 9:07
mveDave Kreskowiak10-May-08 9:07 
QuestionRe: sql server Pin
bapu288910-May-08 23:12
bapu288910-May-08 23:12 
QuestionDisappearing custom CommandBar menu in Excel Pin
dsimms8-May-08 8:05
dsimms8-May-08 8:05 
Questionfread() equivalent in VB? Pin
Phyxion8-May-08 7:49
Phyxion8-May-08 7:49 
AnswerRe: fread() equivalent in VB? Pin
Tim Carmichael8-May-08 7:56
Tim Carmichael8-May-08 7:56 
GeneralRe: fread() equivalent in VB? Pin
Phyxion8-May-08 8:08
Phyxion8-May-08 8:08 
AnswerRe: fread() equivalent in VB? Pin
Phyxion8-May-08 9:26
Phyxion8-May-08 9:26 
GeneralRe: fread() equivalent in VB? Pin
Anubhava Dimri8-May-08 19:57
Anubhava Dimri8-May-08 19:57 
Questionhow can made msn messenger or windows messenger in vb.net?please send me coding of this application and send me msn messenger application in vb.net Pin
mohammedali20068-May-08 7:48
mohammedali20068-May-08 7:48 
AnswerRe: how can made msn messenger or windows messenger in vb.net?please send me coding of this application and send me msn messenger application in vb.net Pin
Tim Carmichael8-May-08 7:58
Tim Carmichael8-May-08 7:58 
AnswerRe: how can made msn messenger or windows messenger in vb.net?please send me coding of this application and send me msn messenger application in vb.net Pin
Christian Graus8-May-08 14:04
protectorChristian Graus8-May-08 14:04 
AnswerRe: how can made msn messenger or windows messenger in vb.net?please send me coding of this application and send me msn messenger application in vb.net Pin
parth.p8-May-08 14:08
parth.p8-May-08 14:08 
AnswerRe: how can made msn messenger or windows messenger in vb.net?please send me coding of this application and send me msn messenger application in vb.net Pin
Jamal Abdul Nasir10-May-08 3:22
Jamal Abdul Nasir10-May-08 3:22 
QuestionPublishing an application with the framework 3.5 Pin
Paul McGann8-May-08 6:57
professionalPaul McGann8-May-08 6:57 
AnswerRe: Publishing an application with the framework 3.5 Pin
Dave Kreskowiak8-May-08 8:36
mveDave Kreskowiak8-May-08 8:36 
GeneralRe: Publishing an application with the framework 3.5 Pin
Paul McGann8-May-08 10:03
professionalPaul McGann8-May-08 10:03 
GeneralRe: Publishing an application with the framework 3.5 Pin
Dave Kreskowiak8-May-08 10:18
mveDave Kreskowiak8-May-08 10:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.