|
I am using VB to update a detailsview I have a dropbox and a textbox
I do detailsview.rows.cells = dropbox.selectedvalue and
detailsview.rows(x).cells(1) = textbox.text. both these lines appear in my ok button. This works and the detailsview is changed. The problem is the database is not changed. How do I update the database with my new values? Thanks in advance
|
|
|
|
|
MUSIWA wrote: The problem is the database is not changed
Why would it have changed? You haven't posted any code which updates the database.
It won't happen by magic. You actually have to write code to do it. If you don't know how to update a database using VB.NET, I suggest you buy a book on ADO.NET and read up on the subject.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
I thought I did I thought there was an update command that I can add to my button to move the data to the database. I guess I was wrong. I am sorry if I insulted your intelligence but I am trying to learn this. Nevertheless I still need some direction. I abadon that though and now I am using an execute command see below
Dim sqlConnection1 As New System.Data.SqlClient.SqlConnection("Data Source=MUSCRIBMPC\SQLEXPRESS;Initial Catalog=adp3SQL;Integrated Security=True")
Dim fname, lname As String
fname = TextBox2.Text
lname = textbox3.text
Dim cmd As New System.Data.SqlClient.SqlCommand
cmd.CommandType = System.Data.CommandType.Text
cmd.CommandText = "update compiledpts set firstname = fname, Lastname= lname where contactid = 2"
cmd.Connection = sqlConnection1
sqlConnection1.Open()
cmd.ExecuteNonQuery()
sqlConnection1.Close()
now this stament does not work even though when I debugg the value of the textboxes have the correct values. The connection string works too. My problem is the command text is not working. Can you help me know what is wrong with it. Thanks!
|
|
|
|
|
MUSIWA wrote: cmd.CommandText = "update compiledpts set firstname = fname, Lastname= lname where contactid = 2"
This won't work. You have to build up the command text string, concatenating the variable values with the literal text. This isn't considered a good approach though, as it leaves your code vulnerable to SQL injection attacks. Consider using a stored procedure and parameters instead.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
How would I detect if the mouse hasn't been moved/clicked and the keyboard hasn't been pressed? I was thinking for the keyboard...
(Under Form4 KeyDown)
If e.KeyCode.BrowserHome = False Then<br />
Me.tmr.Start()<br />
Else : Me.tmr.Stop()<br />
End If
(+Timer)
Static x As Integer<br />
x += 1<br />
If x = 5 Then<br />
Dim form2 As New Form2<br />
form2.Show()<br />
me.hide<br />
End If
modified on Thursday, January 24, 2008 11:35:10 AM
|
|
|
|
|
Bonjour tout le monde.
Hi all.
I developed an application that must be installed on several computer. What's annoyingis that when i modify this application, i have to go and change the .exe on every computer. After some searches on the net, i saw that it is possible to deploy VB6 executable by using Click once. I followed the instructions found on MSDN and i've created the deployment setup MyProgClickOnce.exe.
My problem is that the behaviour of the click once is not what i expected it to be.
So far, I copied the new "MyApplicationExe.exe" in a directory on my C drive, "C:\MyApplication\" with a DB within it.
Now, with the Click Once, a link in my start menu is created "MyProgClickOnce.exe". When i click on this link, the application is welll launched but the executable file (MyApplciationExe.exe) is not in the directory ("c:\MyApplication") then, the link to my DB doesn't work.
I'd like to know if it is possible to specify the directory where I want to install my "MyApplication.exe"??
Thanks in advance
Chris
Mia
|
|
|
|
|
Quick answer No!
Click once gives you no control where you are deploying your app to.
I think there are a number of issues with your information
VB6 - I'm not aware you can deploy VB6 via clickonce
your deployment folder should be a network share folder
If you are deploying the database with each client there will be multiple DBs in the wild. Should you not connecto to a single DB?
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi
Yes, you can deploy VB6 application with click once. It works but I need to choose the place I want to install the Exe.
I don't deploy the Db with all clients, I put it on a server.
Thanks for your answer.
Mia
|
|
|
|
|
Hi Friends,
I want to know the LAN connection Status of the machines connected in the LAN.
I need a code in VB.NET 2003 WebApplication.
Kindly mention the namespaces and detail code to check the LAN connection Status.
Try to make a code easily understandable.
Thanks in Advance
|
|
|
|
|
take a look at
System.Net.Dns.GetHostName(); System.Net.IPHostEntry & System.Net.Dns.GetHostByName();
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
Any idea how to make Skins in VB.NET for stand alone applications...
I had googled but coudn't find any useful information.
Please post any article's or link.
Jats
|
|
|
|
|
There's only two ways that I know of to create custom skins. You'll either have to dive into the Win32 API and paint the forms in your app manually, or you could use some software that will do it for you. DotNetSkin looks like it might be good, but you'll have to check it out.
|
|
|
|
|
I am sure there must be a way to do this, and maybe I am being a bit dim (david as stupid = true), but I can't seem to find the property I need.
I cannot change the order of the data coming in from the stored procedure and I need to move the last column to one from the beginning.
|
|
|
|
|
Hi all,
I have a system with CPU X64 & Vista Ultimate X64, in this system I install VB6 and VB.Net , also I have 2 OCX file and I can use this 2 ActiveX in VB6 , but when I create a project in VB.NET 2005 and then put any ActiveX , now when run my project get this error and my programm not be run !!
Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
|
|
|
|
|
When adding points to a point pair list they are designated as Add(byval doube, byval double). I need the x coordinate to be a dateTime value. Does anyone have any ideas on how to do that?
Thanks.
|
|
|
|
|
The details of how to do that are in the help documentation that comes with Zed Graph. I can't remember them off hand but you will find them there.
|
|
|
|
|
I found it. Thanks so much for the tip.
|
|
|
|
|
Hi to all
i am trying to add one ocx control but it is not get added....
.Add/Remove Components --> Add COM component
Then Add Reference.
I can able to see that control but i am not getting any events...
Please Help me in this regards.........
Thanks
|
|
|
|
|
when you add reference a OCX to your project , then in toolbar mus be see a icon from control , now drag this icon to form and use properties, events, ...
|
|
|
|
|
How do you kill child threads when the parent thread that creates them is stopped?
I have an application that will spawn multiple child threads, but when the parent process is killed, the child threads keep running in the background until they've completed the task assigned to them.
How do you make them abort at the same time the parent aborts? I don't have any control over when the Parent process exits and cannot handle exit events.
Thanks.
SG
Cause is effect concealed. Effect is cause revealed.
|
|
|
|
|
An app remains alive, as long as there are threads running that have their IsBackground set to false,
so set it to true for those background tasks that should not prevent your app from terminating.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
The problem is not the main app exiting. The problem is when I terminate the app, the child threads continue running in the background until they've completed their task.
[Edit]
But MSDN documentation says
Any remaining background threads are stopped and do not complete
which is contrary to what I'm seeing. Am I doing something wrong? The fillip here is that this piece of code runs within SSIS. And this SSIS package is invoked by a Windows Service using SQL SMO.
I'm outta ideas...
SG
Cause is effect concealed. Effect is cause revealed.
|
|
|
|
|
MSDN is right.
An app remains alive, as long as there are threads running that have IsBackground==false (the default value),
so set it to true for those background tasks that should not prevent your app from terminating.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
I have an issue.
The InitializeLifetimeService method of some of my MarshalByRef objects is never called.
I wanted to know would such objects account for Memory Leakage.
Thank you.
Sundip
|
|
|
|
|
Hi to all,
I'm tring to convert project form vb6 to vb.net.
In vb6, I used LenB to determine the size of type.
But in vb.net not supported LenB,
Can anyone tell me what function use instead?
|
|
|
|