|
Google for "ZedGraph". The rest is easy, merely setting up the graph to look the way you want, then passing in the data every second. The graph draws itself.
|
|
|
|
|
Hi,
i want help in writing a savefunction in vb.net.
requirement is:
An array of hat objects is passed into the function. The hat in each object is then saved to the database table.The following properties are set in each hat object :objectID,date,quantity.
Table used is hat1
Parameter passed into the function is arrayhat which is an array of hat objects.
using .net2.0/vb.net/oracle.
Thanks
|
|
|
|
|
So what's the question?
You iterate over the collection of hat objects passed in, get the ID from the object, and check to see if it's in the database. If not, INSERT a new record in the database using the data supplied for that record. If it does exist, UPDATE the existing record. Better yet, this would probably be better suited as a stored procedure in the database. All you would have to do is pass in the 3 parameters to the procedure and it should do the appropriate checks and updates.
|
|
|
|
|
|
Hi:
My boss had selected a contractor. This was to be a "help" in my VB.Net 2005 project. The contractor was supposed to develop a sample GUI for control of an embedded box with a USB interface along with a user library. My boss requested me to provide a specification which i did.
The contractor IMHO ignored a few items in the specification. My exposure to VB.net has been part time during the past few years. What i was trying to specify was that i did not want code developed as DLL's because the delivered source code would be linkable into the main program code space and the VS.net debugger could be used to check values from the main application. I saw this as a method for development. My experience has been that the VS.Net debugger cannot directly examine the DLL code space. The contractor said we could use it this way but i have not been able to do this, does anyone have a method to do this?
Also the contractor said that the specification was confusing and that he developed the code as a DLL by mistake and that it will cost a lot of money for us to fix this. the specification section is below. (OPAL KELLY makes a USB prototype board as a commercial product and is not involved with the contract)
---------------------------------------------------------------------------------
Structure: Software routines shall be called to handle the functions locally. Software functions shall be defined in a local library for linking with discrete programs. DLL calls will be made only for linking to OPAL Kelly software or preexisting Software. The intent is to have subroutines defined that can be used with a Microsoft debugger and have “step into” capability which is not possible for DLL’s as released SW.
-----------------------------------------------------------------------------------
what are your opnions on this. I suspect i might have used better terminology but i think the intent is clear?
charlie
|
|
|
|
|
Yes, the debugger can step into .DLL code. A .DLL is just loaded as part of the process. It's no different than if the code was directly part of the .EXE's code. So long as the .DLL is a Debug build, with the debugging information shipped along with it, the debugger can step into the code with no problems.
A "local library for linking with discrete programs" screams .DLL to me. I don't see how an .EXE would fit this picture since .EXE's don't normally export library functions.
What language is this library written in?
Or did I misunderstand the situation??
|
|
|
|
|
Hi:
The Application code i am using is VB.net 2005, However the library is written in C.
From what you mentioned it looks like the debugger should be able to reference lines of code and values on that line for a "C" library.
Thanks for responding.
Charlie
|
|
|
|
|
The debugger can step into the C code base, but without debug information or the source code, you'll see the machine language representation of the code, not the original C source.
|
|
|
|
|
My project seemed simple.
1. Load a .dll into a separate appdomain
2. Use and unload it
3. Allow the user to modify the .dll via system.reflection
4. Repeat
Simply can't do it... any help appreciated. I'm working now with something like this, but it's very strange. This will not load from "c:\ma.dll" but always loads from the .dll in the current active directory instead. Also, simply cannot release the file after the unload.
Help greatly appreciated.
Dim SubDomain As AppDomain = AppDomain.CreateDomain("New Domain")
Dim s1 As FileStream = New FileStream("C:\ma.dll", FileMode.Open, FileAccess.Read)
Dim ms As MemoryStream = New MemoryStream(s1.Length)
Dim br As BinaryReader = New BinaryReader(s1)
Dim bytesRead As Byte() = br.ReadBytes(s1.Length)
ms.Write(bytesRead, 0, s1.Length)
Dim assembly As Assembly = Reflection.Assembly.ReflectionOnlyLoad(ms.ToArray)
Dim IndicatorClass = SubDomain.CreateInstanceAndUnwrap(assembly.FullName, "Indicators.Indicator")
AppDomain.Unload(SubDomain)
s1.Close()
br.Close()
ms.Dispose()
|
|
|
|
|
I've got an icon in a dropdownbox item, but it isn't in my image list. It was originally loaded from disk, but i've lost that original file. Is there any way to extract it so I can use it somewhere else?
Thanks!
|
|
|
|
|
I'm assuming all you have is the .EXE you want to pull the icon out of. Google for "ResEdit" or "Resource Editor".
|
|
|
|
|
No, I have the code itself. Should be easy I suppose, I just don't know how.
|
|
|
|
|
The image the project gets is from the image file itself. It's not stored anywhere else except cached by the IDE. If you close VS and reopen the project, the thumbnail image is reloaded from the original source file. There's no way to save the icon from the cached image you see inside the IDE.
|
|
|
|
|
Hi all,
I am using the following code:
<br />
Dim connectionString As String = "Initial Catalog=DATABASEName;Data Source=INSTANCENameIthink;Integrated Security=SSPI;"<br />
Dim cn As SqlConnection = New SqlConnection(connectionString)<br />
Dim sqlCommand As SqlCommand = New SqlCommand("SELECT * FROM StagingEmployer ORDER BY StagingDate", cn)<br />
cn.Open()<br />
Dim TestRowset As SqlDataReader = sqlCommand.ExecuteReader()<br />
<br />
While TestRowset.Read()<br />
If (Convert.ToString(TestRowset(35)) = "U") Then<br />
Dim sqlCommand2 As SqlCommand = New SqlCommand("UPDATE stagingEmployerTest SET" _<br />
+ " [Employer_Number] = '" + Convert.ToString(TestRowset(0)) _<br />
+ "', [Name] = '" + Convert.ToString(TestRowset(1)) _<br />
+ "', [Trading_Name] = '" + Convert.ToString(TestRowset(2)) _<br />
+ "', [Business_Number] = '" + Convert.ToString(TestRowset(3)) _<br />
+ "', [Company_Number] = '" + Convert.ToString(TestRowset(4)) _<br />
+ "', [Tax_File_Number] = '" + Convert.ToString(TestRowset(5)) _<br />
+ "', [Street_Address_1] = '" + Convert.ToString(TestRowset(6)) _<br />
+ "', [Street_Address_2] = '" + Convert.ToString(TestRowset(7)) _<br />
+ "', [Street_Address_3] = '" + Convert.ToString(TestRowset(8)) _<br />
+ "', [Street_Suburb] = '" + Convert.ToString(TestRowset(9)) _<br />
+ "', [Street_State] = '" + Convert.ToString(TestRowset(10)) _<br />
+ "', [Street_Postcode] = '" + Convert.ToString(TestRowset(11)) _<br />
+ "', [Street_Country] = '" + Convert.ToString(TestRowset(12)) _<br />
+ "', [Postal_Address_1] = '" + Convert.ToString(TestRowset(13)) _<br />
+ "', [Postal_Address_2] = '" + Convert.ToString(TestRowset(14)) _<br />
+ "', [Postal_Address_3] = '" + Convert.ToString(TestRowset(15)) _<br />
+ "', [Postal_Suburb] = '" + Convert.ToString(TestRowset(16)) _<br />
+ "', [Postal_State] = '" + Convert.ToString(TestRowset(17)) _<br />
+ "', [Postal_Postcode] = '" + Convert.ToString(TestRowset(18)) _<br />
+ "', [Postal_Country] = '" + Convert.ToString(TestRowset(19)) _<br />
+ "', [Contact_Name] = '" + Convert.ToString(TestRowset(20)) _<br />
+ "', [Contact_Title] = '" + Convert.ToString(TestRowset(21)) _<br />
+ "', [Contact_Salutation] = '" + Convert.ToString(TestRowset(22)) _<br />
+ "', [Phone] = '" + Convert.ToString(TestRowset(23)) _<br />
+ "', [Fax] = '" + Convert.ToString(TestRowset(24)) _<br />
+ "', [Email] = '" + Convert.ToString(TestRowset(25)) _<br />
+ "', [Broker] = '" + Convert.ToString(TestRowset(26)) _<br />
+ "', [Underwriter] = '" + Convert.ToString(TestRowset(27)) _<br />
+ "', [Diplomatic_Indemnity] = '" + Convert.ToString(TestRowset(28)) _<br />
+ "', [Status] = '" + Convert.ToString(TestRowset(29)) _<br />
+ "', [Image] = '" + Convert.ToString(TestRowset(30)) _<br />
+ "', [Created] = '" + Convert.ToString(TestRowset(31)) _<br />
+ "', [Created_By] = '" + Convert.ToString(TestRowset(32)) _<br />
+ "', [Modified] = '" + Convert.ToString(TestRowset(33)) _<br />
+ "', [Modified_By] = '" + Convert.ToString(TestRowset(34)) _<br />
+ "', [Action] = '" + Convert.ToString(TestRowset(35)) _<br />
+ "', [StagingDate] = '" + Convert.ToString(TestRowset(36)) + "'" _<br />
+ " WHERE [Employer_Number] = '" + Convert.ToString(TestRowset(0)) + "'")<br />
sqlCommand2.ExecuteScalar()<br />
End If<br />
MsgBox("Result :" + Convert.ToString(TestRowset(35)))<br />
End While<br />
<br />
<br />
' Close Reader and Connection.<br />
TestRowset.Close()<br />
cn.Close()<br />
Now the first section works fine... (the first select statement.) it returns 3 rows of data into my TestRowset.
Now why would the second section (the Update - SqlCommand2.ExecuteScalar() ) give the following error:
ExecuteScalar: Connection property has not been initialized.
???
what does this mean?
I have never done anything like this from scratch so this would be my first attempt.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
The error is pretty self-explanitory. When you created your first SqlCommand object, you told it what the SQL statement was it was supposed to execute AND you told it which SqlConnection object to use. When you created your second SqlCommand object, you never told it which SqlConnection to use, which I believe you called cn .
|
|
|
|
|
okay, thanks.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
hi all i have this function in my DAl that returns a dataset like this
Public Function Get_Data_Straight(ByVal strNumkey As String) As DataSet
Dim strSQl As String = "SELECT Primary_ID, Boundary_area, Attrib_Code, Lis_Key, Func_Key, Actual_Extent, Improved_Value, Site_Value, Purchase_price, Purchase_date, prop_id, confidence_score, fin_ls_prediction, new_lis_key, new_func_key, Tshwane_Prediction, matchflag, source, flagtype, Locked FROM Property_mass WHERE (SUBSTRING(Lis_Key, 1, 4) = @Lis_key) AND (Locked IS NULL)"
Dim constr As String = "user id=sde;Password=@@@@@@;Server=@@@@@@@@;persist security info=False;initial catalog=Tshwane_Valuations_Train"
Dim cmb As SqlCommandBuilder
Dim con As SqlConnection
Dim da As SqlDataAdapter
Dim cmd As SqlCommand
Dim ds As DataSet
Try
ds = New DataSet
con = New SqlConnection(constr)
con.Open()
'Inituializing the Connection Object
cmd = New SqlCommand(strSQl)
'Telling the connection object where is the Database
cmd.Connection = con
'Initializing the adapter
da = New SqlDataAdapter
'we tell the adapter which object we are using
da.SelectCommand = cmd
da.SelectCommand.Parameters.Add("@Lis_key", strNumkey)
' da.SelectCommand.Parameters.Add(New SqlParameter("@Lis_Key", strNumkey))
ds.Clear()
da.Fill(ds, "Property_Mass")
Catch ex As SqlClient.SqlException
MsgBox(ex.Message)
End Try
Return ds
End Function
and i display the results into the datagrid. well everything is working well. do i want to update the Grid when a change has been made. As Commandbuilder will generate a update query for me, i want to know, how am i going to use the commandbuilder in another function in the Dal that will be used to save the changes. is it ok, the way i have declared the command builder locally into the function, or should i make it a shared object so that the other function can access it when it want to update, or the other function is Supposed to create its own command builder.
The below is my update Function in my DAL
Public Sub UpdateLis_search_Straight(ByVal dsData As DataSet)
'update data in the actual database
Dim strSQl As String = "SELECT Primary_ID, Boundary_area, Attrib_Code, Lis_Key, Func_Key, Actual_Extent, Improved_Value, Site_Value, Purchase_price, Purchase_date, prop_id, confidence_score, fin_ls_prediction, new_lis_key, new_func_key, Tshwane_Prediction, matchflag, source, flagtype, Locked FROM Property_mass WHERE (SUBSTRING(Lis_Key, 1, 4) = @Lis_key) AND (Locked IS NULL)"
Dim constr As String = "user id=sde;Password=@@@@@@;Server=@@@@@@;persist security info=False;initial catalog=Tshwane_Valuations_Train"
Dim cmb As SqlCommandBuilder
Dim con As SqlConnection
Dim da As SqlDataAdapter
Dim cmd As SqlCommand
Try
da.UpdateCommand = cmb.GetUpdateCommand
da.Update(dsData)
'adpAccess.Update(dtbschemaDatabases)
Catch ex As SqlClient.SqlException
MsgBox(ex.Message)
End Try
End Sub
PLease help
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Your question doesn't make any sense. A CommandBuilder object will not work with the WHERE clause (as I've said before) you've specified. You're going to have to write the remaining SqlCommand objects (DELETE, INSERT, UPDATE) yourself (as I've said before) and add them to the DataAdapter.
I suggest writing a seperate method that does nothing but creates and builds this DataAdapter and returns it to the caller.
|
|
|
|
|
Am sorry Dave, i will write all myself, forget the short cut and Wizard\
Thanks for Pushing
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Vuyiswa wrote: i will write all myself, forget the short cut and Wizard\
...which you've told me before...
|
|
|
|
|
please help i've been stack for my finall project building mp3 steganography with least significant bit subtitution.
please help me!
|
|
|
|
|
With what??
The question you asked can only have one answer. Google results[^] for "mp3 steganography".
|
|
|
|
|
hi i have written a syntax highlighting program using regex. i selected all the ranges and highlighted one by one.is there anyother fastest way to highlight and my main doubt is if i am intending to type any text or textchange i am able to see the flickering as because i am selecting the particular text and highlighting . could we color particular range of text`s color without selection.(note i am using .net framework 2.0)
with regards
Balagurunathan.B
|
|
|
|
|
The RTB really isn't the best choice for this since performance, no matter you do, will get slower and slower as the length of text gets longer and longer.
But, here's[^] the Google results for "vb.net syntax highlighting richtextbox". You may be disappointed by what you find.
|
|
|
|
|
Hi all,
I working in a project where i want use keypress event in mouse event. So i decided to call Delegates.. But i am getting error...
The Error is in convertion of object to textbox... I give full coding below this.....
Dim myHandler As Windows.Forms.KeyPressEventHandler<br />
<br />
Custom Event myEvent As Windows.Forms.KeyPressEventHandler<br />
AddHandler(ByVal value As Windows.Forms.KeyPressEventHandler)<br />
myHandler = value<br />
End AddHandler<br />
<br />
RemoveHandler(ByVal value As Windows.Forms.KeyPressEventHandler)<br />
myHandler = Nothing<br />
End RemoveHandler<br />
<br />
RaiseEvent(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs)<br />
If Not myHandler Is Nothing Then<br />
Me.TextBox1.Invoke(sender, e) Else<br />
End If<br />
End RaiseEvent<br />
End Event<br />
<br />
Sub raise_event()<br />
Dim sender As New Object<br />
Dim e As System.Windows.Forms.KeyPressEventArgs<br />
RaiseEvent myEvent(sender, e)<br />
End Sub<br />
<br />
<br />
Dim d1 As Windows.Forms.KeyPressEventHandler<br />
<br />
<br />
Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
d1 = New Windows.Forms.KeyPressEventHandler(AddressOf MyDelegate)<br />
End Sub<br />
<br />
Sub MyDelegate(ByVal sender As Object, ByVal e As Windows.Forms.KeyPressEventArgs)<br />
If Asc(e.KeyChar) = 65 Then<br />
MsgBox("65")<br />
ElseIf Char.IsLetterOrDigit(e.KeyChar) <> True Then<br />
MsgBox(Asc(e.KeyChar))<br />
End If<br />
End Sub<br />
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
AddHandler Me.myEvent, d1<br />
raise_event()<br />
End Sub
Can any one tell where should i change.
Note.
I am using Keypress for Textbox. When i click by mouse the keypress event of the textbox should enable and do the required work
Can any one help me to solve this problem.............
Thank you in Advance
Senthil.S
Senthil S
Software Engineer
|
|
|
|
|