|
Add .ToString() to your integer types. For example, instead of tempID use tempID.ToString() .
|
|
|
|
|
Thanks for your reply....
Some how I get to manage solve the error through out the night. The problem solve when replace '+' with '&' in SQL statement.
|
|
|
|
|
That works by itself, actually
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
You should say in the end to datagrid to bind itself.
DataGrid1.DataBind()
|
|
|
|
|
howdy,
I'm having trouble adding a new row to my primary table.
I have a bunch of comboboxes bound to lookup tables and a tertiary binding for each binding selectedValue to the main datarow.
When I try to change the values, and save, the last comboBox fails to change the lookup ID in the primary table, and remains -1, the initialization value.
any ideas?
[snip]
Me.UcInspect1.ucicmbCLLI.DataSource = Me.dvClli<br />
Me.UcInspect1.ucicmbCLLI.DisplayMember = "CLLIName"<br />
Me.UcInspect1.ucicmbCLLI.ValueMember = "CLLIId"<br />
Me.UcInspect1.ucicmbCLLI.DataBindings.Add(New Binding("SelectedValue", Me.dvInsp, "ClliID"))
[snip]
Private Sub newInsp(ByVal sender As Object, ByVal e As System.EventArgs)<br />
Me.dvPlant.RowFilter = "InspNumber = '-1'"<br />
Dim dr As clDatalayer.dsInspData.InvRow<br />
dr = Me.dsData.Investigation.NewRow<br />
With dr<br />
.InspNumber = 0<br />
.CoID = 3<br />
.InvTypeID = 1<br />
.ReasonsID = 1<br />
.InvID = 123<br />
.ExchID = -1<br />
.ClliID = -1<br />
.StatusID = 1<br />
End With<br />
Me.dsData.Investigation.Rows.Add(dr)<br />
Me.BindingContext(Me.dvInsp).EndCurrentEdit()<br />
Me.BindingContext(dvInsp).Position = Me.BindingContext(dvInsp).Count - 1<br />
<br />
End Sub<br />
[snip]
Set the Values in the UI...
At this point all values have changed excapt CLLIID which is still '-1', even though I've selected a CLLI, and the combobox.selectedvalue <> -1. very strange.
[snip]
Private Sub SaveInsp(ByVal sender As Object, ByVal e As System.EventArgs)<br />
Me.BindingContext(Me.dvInsp).EndCurrentEdit()<br />
Dim i As Integer = Me.BindingContext(Me.dvInsp).Position<br />
Me.BindingContext(Me.dvInsp).Position = 0<br />
Me.BindingContext(Me.dvInsp).Position = (i)<br />
Try<br />
Me.procData.setData = Me.dsData 'runs datalayer update<br />
Me.BindingContext(Me.dvInsp).Position = i<br />
MsgBox("Changes Saved")<br />
Catch ex As Exception<br />
MsgBox(ex.Message)<br />
End Try<br />
End Sub<br />
let me know if you have any ideas...It just seems like that last combo isn't committing it's changes.
TIA
Jeremy
Thank you, Thank you, I'll be here all week...
|
|
|
|
|
Hi,
I have a litle problem and I wonder if someone could help me to start while creating MS Word output from VB.
I have to create output (.doc file) which will contain text, pictures, tables, etc.
Examples, references on web pages, .pdf files, web tutorials, e-books, will do.
Deeply Thnx!
Zlatko Stapić
|
|
|
|
|
Microsoft Word uses it's own document architecture. VB provides no support for creating output in the correct Word format.
You need to add a reference to the Word object library to your VB project, then use the Word COM interface to manipulate documents programmatically. The MSDN contains tons of reference materials on using the Word object library functions.
Robert
|
|
|
|
|
Thanks for your reply...
I found lots of materials in MSDN, and solve almost all my problems. One thing is waiting, and that is how to save a created document, but without any
"save as" dialog boxes. But, I thing I'll manage that too.
Thanks Again...
|
|
|
|
|
Thanks for your reply...
I have done some digging in MSDN, and as you said, I found almost everithing I need. Actualy I solved all my problems, except one, and that is how to save a created word document without any "save as" dialogs. But I think I'll manage that too...
Thanks again....
|
|
|
|
|
|
I want undo a text in richtextbox suchas in notepad.exe
How create new form effect richtextbox of previous form (such as form find&replace in notepad.exe)
|
|
|
|
|
Hi,
I am upgrading an application from Vb6 to Vb.net. I am facing a problem in converting Propertybag object. Like it is storing some value with .WriteProperty and then for retrieving .ReadProperty.
Can any one tell me Vb.Net equivalent for that?
thanks
Het Waghela
Be Humble in Victory and Strong in Defeat.
Het Waghela, Blog|Het Waghela DotNet Questions Link|More Links
|
|
|
|
|
NET does not support the PropertyBag object. You have to use NET Serialization instead. Do a MSDN search on Serialization to see simple implementations.
Robert
|
|
|
|
|
|
hello friends,
i want to know about the thread start in the VB.
how can i start the thread using ThreadStart in visual basic.
i use the CreateThread, CloseHandle, TerminateThread etc. but all these are not fulfilling my requirement.
i want when my task is over, the thread is terminated.
how it is possible?
please help me? here is a question of my job...
thanks
Gagan Deep Singla
Chandigarh - INDIA
|
|
|
|
|
Dim t As System.Threading.Thread
t = new Threading.Thread(AddressOf MySub)
t.Start()
The thread will terminate when the code reaches the end. A good way to do tasks in a thread is to encapsulate the thread and task in a class:
Public Class MyTaskClass
Private MyThread As Thread
Public Sub New
Me.MyThread = New Thread(AddressOf Me.MyTask)
End Sub
Public Sub Start
Me.MyThread.Start()
End Sub
Private Sub MyTask
'Start processing here
End Sub
End Class
You can add properties to the class which can be read after the thread has stopped. You can also raise events when something important happens in the thread, maybe telling you that there is important information available through the properties.
When the thread reaches the end of code, it stops. You can't restart it, so if you want to perform the task again, you have to create a new instance of the calss.
|
|
|
|
|
thanx for responsing sir,
i am not talking about the VB.net.
i am talking about vb6.0
if you can help me in that then this is benifial for me.
thank you
Gagan Deep Singla
Chandigarh - INDIA
|
|
|
|
|
Sorry, I do not remember any details of mutithreading in vb6. I played with it about 6 or 7 years ago and decided not to use vb6 for multithreading. Here is a link explaining some of the reasons not to do multithreading in vb6 (it also will point you towards a solution if you must persue multithreading in vb6):
http://www.freevbcode.com/ShowCode.Asp?ID=1287[^]
|
|
|
|
|
Thanx Sir,
i have already study that page completly but not satisfactory answer there.
i searh the google alot but proper use of the functions has not been explained anywhere...
actually i want the threads for copying large file..
i find a dll which is performing the task but author copy the data to the specified location not on mine....
now i am thinking to create a dll file using C# and then use that dll in the VB 6.0
so hopes for the best!
thanx for communicating me....
Bye
Gagan Deep Singla
Chandigarh - INDIA
|
|
|
|
|
There are many reasons why you won't find any answers for VB6, but the most common reason is because you can't debug the code you write. If you start a new thread while your application is running under the IDE debugger, you'll crash the IDE immediately. It wasn't written to handle multi-threaded code.
Now, if you have access to Visual Studio.NET and C#, why are you even wasting your time with VB6 in the first place? C# and VB.NET both make launching new threads and debugging them a trivial process.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanx for responding me sir,
you are right that i should use the C# except the VB6.
but my whole application is in VB6.
i am planning to make a DLL in C# and use that in VB6 after converting it into VB6 compatible.
can you tell me how can a C# DLL converted to VB6 compatible.
thanx again...
bye..
Gagan Deep Singla
Chandigarh - INDIA
|
|
|
|
|
It's not exactly an easy thing to do and understand if you don't already know the in's and out's of COM. You'll have to read up on COM Interop to find out, it's just way too much information to post here. You can start by looking at this[^] page. You've got a bunch of reading to do...
But, keep in mind that your C# .DLL won't work without the .NET Framework installed on the machines that are going to be running your application, even if it's written in VB6.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
sir, there is some command in the C# which converts the C# code to the VB6 compatible code. there is no need of .net framework for that. i am not dead sure about that but whenever i implement that then i will let you know.
we can convert the VB code to C# compatible and vice versa also. then it is totally become the VB6 code after converting it from C#.
command is related to tlbimp. this is just like that or need some R&D for that.
thanx for responsing me...
Gagan Deep Singla
Chandigarh - INDIA
|
|
|
|
|
Here we go again...
Gagan Deep Singla wrote:
there is some command in the C# which converts the C# code to the VB6 compatible code.
If your talking about NGen, you have a problem. NGen will generate a processor specific native version of the code. But, it will generate a version that only works on that processor. If you NGen an assembly on a Pentium 4, the code it can generate will NOT work on a Pentium III. There are even issues with the same processor, but different steppings (versions) of it! You can't tell it to generate code for a specific processor either. It's either the one that it's running on, or you don't run it.
Gagan Deep Singla wrote:
there is no need of .net framework for that. i am not dead sure about that but whenever i implement that then i will let you know.
If you write the thing in C#, you will need the .NET Framework to run it, period. End of story.
Gagan Deep Singla wrote:
we can convert the VB code to C# compatible and vice versa also. then it is totally become the VB6 code after converting it from C#.
No you're not. When you use a VB6 .DLL in a C# app, you're not converting the code to C#. You're actually creating a Runtime Callable Wrapper around the .DLL. This wrapper is an interface between the .NET world and the COM world that the .DLL runs in. It marshals calls and data back and forth between the two. It does NOT convert the code!
When you write a .NET Framework .DLL, the same thing happens when you need to run it in a COM application. This time, it's a COM Callable Wrapper that you have to generate for the .DLL to do the marshalling.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
Is there a way to read only the last 3 lines of a text file. Everything before the last 3 lines is not needed. The last 3 lines do change for each text file.
If any could help it would be great.
|
|
|
|