|
|
hi friend,
i have a big problem which i dont know how to solve it,, it say's when i run the application "parameter is not valid"..and i look the error details that vb.net raise it about system.drawing.stream i run in visual studio .net 2005 i made it in vb.net then i deploy it to another laptop which is vaio model and windows xp prof. version 2002 sp 2 and it coz error..how can i fix that..is there a way to fix the problem...here's my code..
Public Sub LOAD_PICTURE_FROM_DBASE(ByVal i As String)
'Dim myconnection As New SqlConnection(My.Settings.CNString)
'Dim cmd As New SqlCommand("SELECT BLOBID, " & _
'"BLOBData FROM BLOBTest WHERE BLOBID=", DataGridView1.CurrentRow.Cells(0).Value)
Dim appRdr As New System.Configuration.AppSettingsReader
Dim myconnection As New Clsappconfiguration
'Dim myconnection As New SqlConnection(My.Settings.CNString)
Dim cmd As New SqlCommand
Dim da As New SqlDataAdapter
Dim ds As New DataSet
cmd.CommandText = "select * from Temployee_picture where idnumber=" & "'" & i & "'" 'i & "'"
cmd.CommandType = CommandType.Text
cmd.Connection = myconnection.sqlconn
myconnection.sqlconn.Open()
da.SelectCommand = cmd
da.Fill(ds, "Temployee_picture")
Dim c As Integer = ds.Tables("Temployee_picture").Rows.Count
If c > 0 Then
Dim bytBLOBData() As Byte = _
ds.Tables("Temployee_picture").Rows(c - 1)("picturedata")
Dim stmBLOBData As New MemoryStream(bytBLOBData)
emp_pic.Image = Image.FromStream(stmBLOBData)
Else
emp_pic.ImageLocation = Application.StartupPath & "\SplashScreen v3.jpg"
emp_pic.Load()
End If
myconnection.sqlconn.Close()
End Sub
that's the code that load picture from database...please reply me how to solve the this problem..parameter is not valid...
jhols
|
|
|
|
|
Hey
Firstly I cannot see where you are passing any parameters (only had a quick look are you planning on inserting them into the cmd string?) secondly you may be better using a stored procedure then adding the parameters eg:
cmd.Parameters.Add("@DOB", SqlDbType.DateTime).Value = DOB.Date;
Hope this helps
Dan
|
|
|
|
|
the error suggests that there is something wrong with the sql string.
did you try the sql string directly into the server?
my first idea would be to check the datatype of idnumber if it is a number (as the name suggests) then there is you'r mistake since you are trying to pass a string to it.
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistaks.
|
|
|
|
|
i was new in vb.net,and have explored and grew because of CodeProject and the books i bought and articles on the net. previous i got small projects that did not need a Dall and Bll, am afraid because i have been moved to large projects.So i need to learn BLL and DAl, how they work , how they commnicate, structuraly where and how to code them, and where to place them. i was looking at ASP.net DAL and BLL code, i understood, but am building desktop Applications. i would like anyone to point to an article or E-book to explains Dal and BLL for vb.net Desktop Application, that has to do with Database Programming.
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
|
|
|
|
|
The DAL and BLL will be the same as if you were doing a web app (pretty much) so for example you will have user inputs a string and clicks ok, this will get passed to say a user BLL object that in this case may format it (over simplified) which will then pass it to a user DAL object that will persist the data to your data store. No doubt the tutorials you looked at where at www.ASP.net so you can do the same with a desktop app but replace the User Interface (thats the beauty of an n-tier approach)
Hope this is of use
Dan
|
|
|
|
|
Thanks
very much it helps
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
|
|
|
|
|
Hi All,
I want to export data from sql Server into Excel in text format with Visual Basic 6.0. Becoz there are some value which are convert into date at export time, but actual value like 1144/05-06. If any one have some idea plz help me.
Thanx & Regards
SMK
|
|
|
|
|
|
Thanks For Replying ,
Now i am able to move the runtime controls on the form and place any where , no problem with that .Now i am in doing the things like these::
1) Setting the properties of those runtime controls
2) When i mouse down on that particular runtime control it has to display rectangles on edges of the control and able to resize the control.
I am searching the net . i got some answers ,But Trying if u have any resource links Give to me please ..
Regards
D.V.Sriram
|
|
|
|
|
There is no property to turn any handles on. You'd have to embed the control you dropped in a container control, bigger than the control you dropped, and draw the handles yourself on the container control.
|
|
|
|
|
HI all
I am working on a application where i am taking PDF file as source and writing it into a text file. My problem is i don't want the tables from the pdf file, I just want the paragraphs.
My final output in text file should only contain paragraphs ( i just want to escape the table part). Can any one help me out, I tried in Google searching for any solution but all provides way to extract the data. I want some kind of filter mechanism in my VB application. It would be great if any one can provide the code.
PL help
Regards
Prakash Mishra(Banglore,India)
|
|
|
|
|
I'd imagine this kind of functionality would be exposed by the PDF library you're using??
I don't use any of them, so I really couldn't tell you. But I'd probably start by researching how the PDF document is exposed by the library and search for anything that might describe the document in sections or if it exposes any kind of Select and/or Copy methods that allow you to specify text only.
|
|
|
|
|
I have a Tab Control with 3 tabPages i have a button in first Tab page when i click the button it has to show me the 2 tab page
Could anyone help me
Thanks in Advance
Vidya
|
|
|
|
|
I don't think that is it possible.
'Enabled' and 'Visible' TabPages in Tabcontrol don't exist.
I search for this a lot and in some site they say same thing.
One solution for you could be to work with frames instead.
Shay Noy
|
|
|
|
|
Thank u for ur reply
But we have a option like the code below
Me.TabControl1.TabPages.Item(2).Show()
this is not working can u help me out to know what may be the problem
I am trying this because in Vb.net 2003 its possible
|
|
|
|
|
Thanks a lot for trying
I got the Solution
TabControl1.SelectedTab = TabControl1.TabPages.Item(1)
or
TabControl1.SelectedIndex = 1
|
|
|
|
|
following your reply, I understand right now your question.
I thought that you want to make visible the 2 others tabs after clicking on the button, and that is not possible.
When you said visible you mean select them.
Try to be more clear at next time, you may saved time because I knew how to do it before.
Shay Noy
|
|
|
|
|
hey guys,
kindly help me here. i'm a beginner in using vb.net. so i'll just ask a very simple question,hope you can help me here..
How can i hide my mouse cursor on one of my forms. I add a splash screen on my project, then my mouse cursor still shows even if i already inputted use showcursor(false) on my form's code. i think i had a problem with my code i got from the internet that says "use the API".
Can you give me a full code and on how will i use it on my project?
Thanks a lot guys..
|
|
|
|
|
I got a solution which may be helpful
I have a Splash Screen and Form1
In Load event of Splash Screen input as Windows.Forms.Cursor.Hide()
But when u get to form1 then u should make it visible in the load
|
|
|
|
|
got it! thanks!
this is just what i need..
|
|
|
|
|
I am writing an application that uses multiple forms but with only the start-up form showing in the task bar. I would greatly appreciate it if anyone could tell me how I can hide all forms when the start-up form is minimized, and then show them again when the start-up form is restored.
Thanks
|
|
|
|
|
Hi,
AFAIK when you show a main form, and it shows additional forms with either Show() or
ShowDialog(), you can pass an optional reference to your main form as the one argument
of Show()/ShowDialog(); if you do, all slave forms will follow their main form:
when the main form is minimized, so are the slave forms; and when the main form is restored,
so will be the slave forms. That is what form ownership is about.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Thanks Luc
I've only been programming for a few weeks and hadn't come across form ownership
before, so I appreciate you pointing me in the right direction.
Dave
|
|
|
|
|
Hi i'm just trying to find out if there is an easy way of creating custom wizards to gather user input in a windows application using VB.NET 2005. I have looked all over and only have come across something called magic library and I have no idea how to use the control as it does't give any steps to creating a wizard(at least with the version I found)
Mr Oizo
|
|
|
|