|
Hello,
Im currently working on a Database project using VB.NET 2003; the database contains a table "patients" with general fields like name , address , Date of birth , all are text and one field 'photo' which holds an image. How can i store and retrive the image to a picturebox in vb.net?
Is there a better method?
Thanks
Gopi Charan
|
|
|
|
|
Personally would not save them in the database, but just a reference to a file name/url. But if you must you need to use an OLE field and store the image as a Blob.
There are plenty of examples, have a look on google:
Storing Images Access Database[^]
Hope this helps
Tom
|
|
|
|
|
Hi,
Oracle Ver. 8.1.7
Client : ODP.Net ver 9.2.4
App. using VB.net
I have an application for our sales people, where our sales people prepare Client Visit Reports in MS Word (.Doc). At present they are entering the visit details into my application, now they want this report prepared in Word document also to be stored into the database and will be removed from their local drives. Anybody shld access the Report doc only thru this application.
I need to achieve the following :
1. User shld be able to upload a word file to the DB from a mapped drive.
2. Once loaded user shld be able to open the word file stored in the DB, thru the application and edit it and save it again.
I'm using Stored Procedures for all my DML.
Can we achieve this.
TIA
|
|
|
|
|
is there any method to build datagrid with check boxes.
|
|
|
|
|
Hello
It is there
There r two methods
first one is in ur Datasource table you sholud be craeat the Boolean Column
the u give the DataGrid DataSource
Datagrid.Datasource = Table (Table with Boolean column)
Otherwise create the table style Of DataGrid
Dim m_tbs as new DataGridTableStyle<br />
with m_tbs<br />
dim col as mew DataGridBoolColumn<br />
with col<br />
.MappingName= ColName
.witdh=180<br />
<br />
<br />
end with<br />
.GridColmnStyle.Add(col)<br />
end with<br />
<br />
DataGrid.TableStyles.Add(m_tbs)
I hope This will help to u
|
|
|
|
|
i have a database which contain 2 tables
"table1" and "table2"
i had defined primary and foreign keys
i had use adapter adap1 for "table1" and adap2 for "table2"
now i had generated a dataset "ds" using adap1 and adap2
adap1.fill(ds)
adap2.fill(ds)
now i want to have a relation in both tables
in wizard , we can do this by going into schema of dataset and creating relation
but can it be done through code
plz help
code will be more useful
|
|
|
|
|
|
Yes Sumit
you can do that
dim dr as DataRelation<br />
dr = new DataRelation("myRelation",ParaentCol,ChildCol)<br />
DataSet.Relations.Add(dr) But in this case u can do only with that dataSet tables itself
means if u have two tables in dataset u can make ralationship with the two tables
I hope this helps
Ishak
|
|
|
|
|
Hi, All
I Face a problem using data grid
how can I use datagrid Table Style and ColumnStyle Using SQL Statement Not only one table
I hope to get the answer programatically
|
|
|
|
|
Yaa U can do,
First u get the Shema Information Of the Table Through DataReder.GetShemaTable
So Now u can get the Schema information means column name and datatype etc
then in for loop u can give that information to dataGridTablestyles
Ishak
|
|
|
|
|
Hi To ALL,
can i access SQl server database in windows service application in VB.NET. If so pls give some hints
Thanks
Mahesh
|
|
|
|
|
Yes...
Use Google.
Seriously... DB access is DB access reghardless of what the client (application) is. Al a windows service is is an exe file run under a different context...
Probably ther biggest issue you might have is security access tothe DB. You might have to either impersonate a specific user in your DB access code or run the service under a speciai account that has access to the DB.
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
My Blog[^]
|
|
|
|
|
Need help if possible with class project
need to write program in vb.net for school
the program should provide the height of a ball thrown straight up into the air. the program should request the initail height, hfeet, an dthe initail velocity, v feet per second, as input. The four options to be provided by buttons are as follows.
a)Determine the maximum height of the ball. Note:The ball will reach its maximum height after v/32 seconds.
b)Determine approx when the ball will hit the ground. Hint:Calculate the height after every .1 second and observe when the height is no longer a positive number.
c)Display a table showing the height of the ball every quarter second for five seconds or until it hits the ground.
d)Quit
The formula for the height of the ball after t seconds, h + v*t-16*t*t, should be specified in a user-defined function.
Any help would be greatly appreciated.
Thanks
|
|
|
|
|
Why, oh why, are they teaching VB.net in schools ?
We're happy to help, but not to do your homework. First, you try. That's the point of the exercise. The world does not need this program, but you need to try and write it in order to solidify what you should have learned in class.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
No problem I'll post what I have so far. I am having a problem getting the fuction to work properly.
Thanks for the encouragement. I only need help not the solution.
Thanks again
|
|
|
|
|
This is what I ahve so far.
Private Sub btnDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
Dim h As Double 'h is height
Dim v As Double 'v is velocity
Dim t As Double 't is time
Dim ballHt As Double
h = CDbl(txtIniHeight.Text)
v = CDbl(txtIniVelocity.Text)
t = 0
CalcBallHt(h, v, t, ballHt)
lstResults.Items.Clear()
lstResults.Items.Add(ballHt)
End Sub
Function CalcBallHt(ByRef h As Double, ByRef v As Double, _
ByRef t As Double, ByRef ballHt As Double) As Double
ballHt = h + v * t - 16 * t * t
Return ballHt
End Function
I am having a problem getting the function to work
I am sure it has something to do with the variable time but i'm not sure how to resolve this.
Please Help
Thanks
|
|
|
|
|
hello
Now WHat u want Exactly Your Programe work Properly as per ur requiste
for example
If u give h=2 and v= 2 then it will return 2
How BallHt= 2+2*0-16*0*0 remains 2*0-0 remains 2
it will execute in BODMAS order
I dont know waht result exactly u want,if u get wrong result change ur formula with brackets the first part u want to execute
Ishak
|
|
|
|
|
how to connect crystal reporet in vb
vikash ranjan
|
|
|
|
|
Hey guys/gals,
Im getting a return error of 11 when i try to run this
code:
Region " waveInOpen "<br />
'opens input for recording<br />
<DllImport("winmm.dll", EntryPoint:="waveInOpen", _<br />
CallingConvention:=CallingConvention.StdCall)> _<br />
Public Shared Function waveInOpen(ByRef lphWaveIn As IntPtr, ByVal uDeviceID As Integer, _<br />
ByRef lpFormat As WAVEFORMAT, ByVal dwCallback As Integer, ByVal dwInstance As Integer, _<br />
ByVal dwFlags As Integer) As Integer<br />
<br />
End Function<br />
<br />
'used to describe format of wave data<br />
<br />
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi)> _<br />
Structure WAVEFORMAT<br />
Friend wFormat As Integer<br />
Friend nChannels As Integer<br />
Friend nSamplesPerSec As Integer<br />
Friend nAvgBytesPerSec As Integer<br />
Friend nBlockAlign As Integer<br />
End Structure<br />
<br />
Private Const WAVE_MAPPER As Integer = -1&<br />
Private Const WAVE_FORMAT_DIRECT As Integer = &H8<br />
Private Const CALLBACK_NULL As Integer = &H0<br />
Private Const WAVE_FORMAT_PCM As Integer = 1<br />
Private structWaveInputVars As WAVEFORMAT<br />
<br />
<br />
#End Region<br />
<br />
Here's how im calling wave open. please note there are no calbacks
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
Dim l As Long<br />
l = waveInGetDevCaps(0, structWave, Marshal.SizeOf(structWave))<br />
With structWaveInputVars<br />
.wFormat = WAVE_FORMAT_PCM<br />
.nChannels = 2<br />
.nSamplesPerSec = 11025<br />
.nAvgBytesPerSec = .nSamplesPerSec * .nBlockAlign<br />
.nBlockAlign = 4<br />
<br />
End With<br />
Dim hDevice As IntPtr<br />
<br />
<br />
l = waveInOpen(hDevice, 0, structWaveInputVars, 0, 0, CALLBACK_NULL)<br />
Please ignore the waveingetdecaps. that works for me.
I used to be great with win apis in vb6....now not so greay in vb.net
Any help would be greatly appreciated
I got it....NOPE
|
|
|
|
|
<structlayout (layoutkind.sequential)=""> _
Structure WAVEFORMAT
Public wFormat As Short
Public nChannels As Short
Public nSamplesPerSec As Integer
Public nAvgBytesPerSec As Integer
Public nBlockAlign As Short
End Structure
|
|
|
|
|
<StructLayout (LayoutKind.Sequential)> _
Structure WAVEFORMAT
Public wFormat As Short
Public nChannels As Short
Public nSamplesPerSec As Integer
Public nAvgBytesPerSec As Integer
Public nBlockAlign As Short
End Structure
ERROR_BAD_FORMAT (11) An attempt was made to load a program with an incorrect format.
|
|
|
|
|
Ok now i am getting error 32. whats that one??
I have declared structure variables as public and
changed the data points to short...the ones that you have changed.
Thanks a lot for your help so far
I got it....NOPE
|
|
|
|
|
ERROR_SHARING_VIOLATION (32)
32 The process is being used by another process.
show me your new code
|
|
|
|
|
heres the code now:
<br />
#Region " waveInOpen "<br />
'opens input for recording<br />
'had to take entry tag out please note<br />
DllImport("winmm.dll", EntryPoint:="waveInOpen", _<br />
CallingConvention:=CallingConvention.StdCall)> _<br />
Public Shared Function waveInOpen(ByRef lphWaveIn As IntPtr, ByVal uDeviceID As Integer, _<br />
ByRef lpFormat As WAVEFORMAT, ByVal dwCallback As Integer, ByVal dwInstance As Integer, _<br />
ByVal dwFlags As Integer) As Integer<br />
<br />
End Function<br />
<br />
'used to describe format of wave data<br />
<br />
<StructLayout(LayoutKind.Sequential)> _<br />
Structure WAVEFORMAT<br />
Public wFormat As Short<br />
Public nChannels As Short<br />
Public nSamplesPerSec As Integer<br />
Public nAvgBytesPerSec As Integer<br />
Public nBlockAlign As Short<br />
End Structure<br />
<br />
Private Const WAVE_MAPPER As Integer = -1&<br />
Private Const WAVE_FORMAT_DIRECT As Integer = &H8<br />
Private Const CALLBACK_NULL As Integer = &H0<br />
Private Const WAVE_FORMAT_PCM As Integer = 1<br />
Private structWaveInputVars As WAVEFORMAT<br />
Heres where the function is called:
<br />
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
Dim l As Long<br />
l = waveInGetDevCaps(0, structWave, Marshal.SizeOf(structWave))<br />
With structWaveInputVars<br />
.wFormat = WAVE_FORMAT_PCM<br />
.nChannels = 2<br />
.nSamplesPerSec = 11025<br />
.nAvgBytesPerSec = .nSamplesPerSec * .nBlockAlign<br />
.nBlockAlign = 4<br />
<br />
End With<br />
Dim hDevice As IntPtr<br />
<br />
<br />
l = waveInOpen(hDevice, 0, structWaveInputVars, 0, 0, CALLBACK_NULL)<br />
<br />
End Sub<br />
<br />
I got it....NOPE
|
|
|
|
|
I went back to check the structure and I find there is more to the structure.
<structlayout (layoutkind.sequential)=""> _
Structure WAVEFORMAT
Public wFormatTag As Short
Public nChannels As Short
Public nSamplesPerSec As Integer
Public nAvgBytesPerSec As Integer
Public nBlockAlign As Short
Public wBitsPerSample As Integer
Public cbSize As Integer
End Structure
Let me dig through some of my past source, because I came across this problem before and I know I found a fix for this problem.
|
|
|
|