|
An article was printed about one week ago, week of Jan. 29, 2007, regarding purchase of Window s Vista. The article stated that a user can purchase the Ultimate package for around $200. I am wondering how one goes about this. Please let me know at EMAIL given. Thanks, Sid Kraft
Sid
|
|
|
|
|
how does this relate to VB.NET ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Well VB .Net will not be supported under Vista
Bird with no beak was born to succeed.
|
|
|
|
|
Christian: I am using Visual C++ 6.0, not VB. Sid Kraft
Sid
|
|
|
|
|
Then why are you asking a non-programming question, in a forum for a language you don't even use ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian: Sorry, thought I was sending a question to the Windows Group, Sid Kraft;)
Sid
|
|
|
|
|
I am reading a word document in a byte stream and trying to insert it in sql server table (field is varbinary type). The byte array contains 1000s elemets but in table it writes only '0xD0'.
Any idea what's wrong with it?
Thanks
Nas
|
|
|
|
|
manisghouri wrote: Any idea what's wrong with it?
Nope. Perhaps if you showed us what your code it we might be able to see what it wrong with it.
|
|
|
|
|
'To add document
'---------------
Private Function AddRequest(ByVal DocId As String, ByVal DocUSer As String _
, ByVal DocTitle As String, ByVal DocSubject As String, ByVal fileName As String) as Boolean
Dim cmd As New SqlCommand
Dim dr As SqlDataReader
' Read the Data into the Byte Array
Dim fStream As New FileStream(fileName, FileMode.Open, FileAccess.Read)
Dim DocData(fStream.Length) As Byte
fStream.Read(DocData, 0, CInt(fStream.Length))
fStream.Close()
With cmd
.CommandType = CommandType.StoredProcedure
.CommandText = "sp_AddDocument"
.Connection = Conn
Dim para1 As SqlParameter = .Parameters.Add("@DocId", SqlDbType.Varchar)
Dim para2 As SqlParameter = .Parameters.Add("@DocUser", SqlDbType.Int)
Dim para3 As SqlParameter = .Parameters.Add("@DocTitle", SqlDbType.VarChar)
Dim para4 As SqlParameter = .Parameters.Add("@DocData", SqlDbType.VarBinary)
para1.Value = DocId
para2.Value = DocUser
para3.Value = DocTitle
para4.Value = DocData
End With
Try
dr = cmdBrochureRequest.ExecuteReader
With dr
If .HasRows Then
While .Read
DocStatus = .Item(0)
isDone = True
End While
Else
MsgBox("No Document status retrieved", MsgBoxStyle.Critical, appTitle)
isDone = False
End If
End With
cmd.Parameters.Clear()
cmd = Nothing
dr.Close()
Catch ex As Exception
MsgBox("Error while inserting document into database:" & vbCrLf & ex.Message.ToString, MsgBoxStyle.Critical, appTitle)
isDone = False
End Try
If isDone = True Then
isDone = AddRequestDetail(RequestId)
End If
Return isDone
End Function
'To read document
'---------------
Private Function OpenDocument(ByVal DocId as string)
Dim cmd As New SqlCommand
Dim dr As SqlDataReader
With cmd
.CommandText = "sp_GetDocument "
.CommandType = CommandType.StoredProcedure
.Connection = ConnPIMPS
.Parameters.AddWithValue("@DocId", DocId)
End With
Try
dr = cmd.ExecuteReader
dr.Read()
Dim FileData(dr.GetBytes(0, 0, Nothing, 0, Integer.MaxValue) - 1) As Byte
dr.GetBytes(0, 0, FileData, 0, FileData.Length)
DisplayDocument(FileData)
dr.close
Catch ex As Exception
MsgBox("Error while opening document :" & vbCrLf & ex.Message.ToString, MsgBoxStyle.Critical, AppTitle)
Exit function
End Try
Private Sub DisplayDocument(ByVal arrInput() As Byte)
Dim i As Integer
Dim sOutput As New StringBuilder(arrInput.Length)
For i = 0 To arrInput.Length - 1
If Not CType(arrInput(i), Byte).ToString = 0 Then
sOutput.Append(Chr(arrInput(i)))
End If
Next
RichTextBox1.text = sOutput.ToString()
End Sub
Do you think it is what i required to save word document in sql server table,
regards
Nas
|
|
|
|
|
Hi all!
How can i fill color on Detail section of data report <vb6>.Please help .
Thanks.
|
|
|
|
|
I've got three comboboxes. ComboBox1 has two selections, (a) and (b). I can't figure out how to go about to pick one and driving ComboBox2. I'd like to pick (a) from ComboBox1 and have ComboBox2 know that when I pick (a), the associated data selections would be selectable in this ComboBox. Both (a) and (b)have specific data tied to each of them and I need it to know how to differentiate.
When I pick from ComboBox2, this will also drive what I can select in ComboBox3, but I need help getting started first.
Thanks.
|
|
|
|
|
In this event of combobox1 'combobox1_selectedindexchanged' determine which was selected and call the appropriate routine to load/replace the contents of combobox2.
|
|
|
|
|
Thanks.
I hate to ask too much, but I am rusty (2 years since coding of any form). Could you please explain "which was selected and call the appropriate routine to load/replace the contents of combobox2"?
I appreciate the help.
|
|
|
|
|
When the event fires, you need to check combo1 for what the user selected. Then react accordingly. There are 3 properties you can check to do this. Once you know what they selected, then call the appropriate routine to load the correct values in combo2 that belong to the selection they made in combo1
the properties:
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Select Case ComboBox1.SelectedIndex 'if you hardcoded the contents of combo1
Case 0
Call FillCombo2WithATypes()
Case 1
Call FillCombo2WithBtypes()
End Select
Select Case ComboBox1.SelectedText 'what they see in the combo list
Case "A - type "
Call FillCombo2WithATypes()
Case "B - type "
Call FillCombo2WithBtypes()
End Select
Select Case ComboBox1.SelectedValue 'the code for what they see
Case "A"
Call FillCombo2WithATypes()
Case "B"
Call FillCombo2WithBtypes()
End Select
End Sub
|
|
|
|
|
I am using windows datagridview. I have added datagridtextboxcolumn as first column and the next column and remaining columns are from database. When I run the application 2nd column is highlighted, instead of first column. I want to highlight first column. I am using "Row header selection mode". I think this behaves when row header selected then selects entire row otherwise it behaves like "cell select" mode which selects the cell. Since I am adding datagridtextboxcolumn as my first column , it is highlighting 2nd column. Please advise how to select first column i.e datagridtextbox column instead of 2nd row. Also, I still need rowheader selection mode.
I appreciate your help!
Thanks,
Nilika
|
|
|
|
|
Hi All,
I want to create a playlist in WMP, so that the user can click "next" to go to the next video clip and "previous" to go back.
Could anybody advise me on 'HOW' to do this? or direct me to a tutorial. Ive searched the web and cannot find one.
Thanks in Advance.
Jaidev
|
|
|
|
|
i use arrays in vb.net
but i have a problem in the dimension
ex :
dim a() as integer
a(0)=new integer
gives error
i don't want to use arraylist because i dound inutil to do the cast
|
|
|
|
|
Could you display your real code please? What are you really setting a(0) equal to? I mean, you are not actually setting it to New Integer right? You are setting it to an actual value? And what is the error that you are getting?
|
|
|
|
|
i'm defining a vector without defining its size
so when i make new to allocate in memory
i get the eror : not set to an instance
|
|
|
|
|
I haven't been able to get through this error without defining the size of the array upfront. If you are using Visual Studio 2005 you can use a List object instead. It is like an ArrayList except that you must declare what type of objects are being listed, so you will not have to worry about the overhead of casting the objects into what you want. Here's how you declare it:
Dim objList As New List(Of Integer)
Hope this helps.
|
|
|
|
|
dim a() as integer
array.Resize(a,0) ' or redim preserve a(0)
a(0) = 9999
|
|
|
|
|
thanks
that's work
now i have a bigger question
if a fuction return a vector
public function f() as integer ()
dim a() as integer
redim preserve a(0)
redim preserve a(1)
a(0)=1
a(1)=0
return a
end function
-----------------------------------
dim k () as integer
k=f()
msgbox(k(0)) ------->gives error : not set to instance
|
|
|
|
|
1) if you know how many you'll have you can do a 'static' array
dim a(1) as integer 'creates 0 both instances 0 and 1
2) you don't need to do a redim twice if you know how big you want to make it.
redim preserve a(1) 'will create both instances 0 and 1
3) ran you code... ran fine for me...???
|
|
|
|
|
man thanks but
the problem is when the functon return the vector ...
it allways be null
|
|
|
|
|
Maybe you should post a bigger junk of code or help explain the situation in further detail . I tested your code also and it works perfectly. Something else has to be going on.
|
|
|
|