|
Given the existence of intellisense, how can someone even intuitively know the command they need, and still not find it ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Christian Graus wrote: how can someone ... not find it ?
That is a though one.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Dim x() as String
Dim str as String = "Name1 Name2 Name3"
x = str.Split(" ")
'Now x(0) will be Name1, x(1) will be Name2, etc.
|
|
|
|
|
|
Do some experimentations before asking for help. You store it in a "string" and you want to "split" it. Your question contains the clue in itself. Use the String.Split() method. .NET has made it very easy and intuitive to learn and to do programming. Yet, people keep asking such basic questions.
|
|
|
|
|
Hi,
I want to delete my sql database entries, i.e. delete all the rows of database "payments".
I have written this code:
Public Function DeletePayRecord()
cmd = New SqlCommand("Select * FROM payments", con)
If con.State = ConnectionState.Closed Then con.Open()
myDA = New SqlDataAdapter(cmd)
Dim myPayDeleteDataSet As New DataSet()
myDA.Fill(myPayDeleteDataSet, "payments")
For Each dr As DataRow In myPayDeleteDataSet.Tables("payments").Rows
dr.Delete()
Next
End Function
I found that my rows are not getting deleted. Please suggest me how to do this?
Thanks.
|
|
|
|
|
You're kind of taking the long way with what you have so far. You can use what you have and just add that you need to do an update back to the database...or you can start over and use a Delete SQL statement.
If you use the Delete SQL statment
DELETE * FROM payments
You don't even need a data adapter. Just run the command with an execute nonquery.
|
|
|
|
|
Please send me the code for VB. I want to delete all the rows of column "Date of Joining" when this column is > 1/1/2009.
I tried with this:
cmd = New SqlCommand("Delete * FROM payments WHERE [Date of Joining]> '" & 1 / 1 / 2008 & "'", con)
cmd.ExeceuteNonQuery()
Its is not working. Kindly suggest some code on this.
thanks
|
|
|
|
|
Well, what error are you getting or what is it doing?
|
|
|
|
|
I am not able to delete the database.
|
|
|
|
|
no need for & and too many double quotes!
and 2008 <> 2009
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Even better Truncate Table Payments .
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
|
|
|
|
|
Are the triple bangs in your subject line significant?
|
|
|
|
|
yes. it is a subtle way to indicate urgency without vexing anyone...
and it worked well.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Luc Pattyn wrote: yes. it is a subtle way to indicate urgency
That's the problem. It is just too subtle. Chris ought to allow these folks to type the subject line in a rainbow of colors, or maybe use the blink style. Or both! (!!!)
Luc Pattyn wrote: without vexing anyone
That's important. I have heard that there are some old codgers here on CP who consider noobs an acceptable substitute for cold pizza and stale coke.
|
|
|
|
|
whatever we try, I guess there will always be some cold pizza and stale coke. That's the price we pay for helping out around here...
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Luc Pattyn wrote: I guess there will always be some cold pizza and stale coke.
2 of the 4 food groups that helped me make more'n one roll-out.
I spent a little time tonight hitting you with some 5's. Your answers are bang-on and obviously an attempt to teach them how to fish for themselves (which is probably why you don't get enough thanks.)
|
|
|
|
|
I'm not really fishing for thanks; when I sense some interest, I try to stimulate it.
When some one doesn't like it, so be it.
Cheers.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Luc Pattyn wrote: I'm not really fishing for thanks
All the more reason for folks to be grateful to you, IMHO.
|
|
|
|
|
cmd = New SqlCommand("DELETE FROM payments", con)
cmd.ExecuteNonQuery()
|
|
|
|
|
Hello Everyone,
I've apparently broken the update link used when publishing an update of a windows application.
The situation is this: Recently we have been required to publish the application to two seperate publishing sites.
After publishing to the alternate sight, I reset the publishing and installation locations to the original sites, but now I'm getting warning messages specific to publishing and the users of the primary site can no longer receive updates.
Is there a way to fix this???
Here are the warning messages I'm getting:
Warning 7 Files could not be downloaded from http:
Warning 8 Unable to view published application at http:
Any help on this would be much appreciated...
cb
|
|
|
|
|
Hi,
Sorry about the error message. I'm reposting it with returns.
Warning 7 Files could not be downloaded from
http:
The remote server returned an error: (404) Not Found.
1 1 MAPproject
Warning 8 Unable to view published application at
http:
1 1 MAPproject
cb
|
|
|
|
|
I am creating a little MDI application, and have just a small issue.
I set my main form to be an mdiparent, then I add a flowlayout panel docked to the left with buttons which instantiate a new mdi child form. I want my mdiparent area to be over the menu as well so when you move the child it can go over the menu / flowlayoutpanel I added as well.
FlowLayoutPanel
Me.MenuArea.Dock = System.Windows.Forms.DockStyle.Left
Me.MenuArea.Location = New System.Drawing.Point(0, 0)
Me.MenuArea.Name = "MenuArea"
Me.MenuArea.Size = New System.Drawing.Size(196, 509)
Me.MenuArea.TabIndex = 1
Form
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(805, 509)
Me.Controls.Add(Me.MenuArea)
Me.IsMdiContainer = True
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)
I pretty much want the MenuArea to be UNDER the MdiContainer, so that all child forms instantiated will be able to be over the menu.
Any ideas?
|
|
|
|
|
AFAIK you cannot get the MDI child over controls in MDI parent. Even SetWindowPos does not works.
|
|
|
|
|
As already said, can't be done.
However, you could make your menu just another MDIChild form. Position it in code at the start of the app, maybe handle the move event to stop anyone moving it, and make sure you initialise it with a reference to the Host Form so it can do it's work as a menu.
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
|
|
|
|