|
Can i get entire datatable to be updated by adding new rows directly and not column values that way i can merge tables and update database
|
|
|
|
|
Yes. You can insert rows into the database without getting the rows and merging new rows into it, then writing the whole thing back to the database.
|
|
|
|
|
That is the question How? I used merge and loaddatarow method and then commandbuilder method to update but it did not worked.
|
|
|
|
|
If all this method is doing is writing changed data back to the database, why are you getting a set of records using an SQL, only to replace some of those records and write the whole thing back to the database. This is very inefficient.
Skip this step entirely and just write the dataset your passing into this function to the database. From what I've read in the code, there is no reason at all to retrieve a new dataset first and merge the passed in set into it.
Now, onto why the commandbuilder fails. If the SQL statement does not return the primary key of a table, it will fail. If you pass in an SQL statement that does joins, it will fail. CommandBuilder will only work with SQL that returns a single, keyed, non-joined table.
|
|
|
|
|
When i use crystal report then i can use a image in crystal report at design time but i want that a image which display in crystal report at runtime from ms access database?
Anshul Soni
|
|
|
|
|
Hi Guys,
I have something to ask if someone knows how can I open the file that i choose from the filelistbox? Every time I select a file in the filelistbox, nothing happens it will not open.
This is my code.
<br />
Dim a As String<br />
a= Shell("rundll32.exe url.dll,FileProtocolHandler " & FileListBox1.SelectedItem)<br />
Pls guys, I need you help on this one.
Thank you!
annir
|
|
|
|
|
Hello Annir,
Have a look at the given web link which provides similar information.
http://www.developerfusion.co.uk/show/278/
I hope this will assist you.
Regards,
Allen Smith
ComponentOne LLC
www.componentone.com
|
|
|
|
|
Use System.Diagnostics.Process.Start() .
|
|
|
|
|
Question is pretty straight forward. Is it possible to check for x32 vs x64 processors in vb6?
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
|
Score! Exactly what I was looking for. I figured it would be yet another call into Kernel32, but was unaware of how to do it.
Thanks!
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
Hi all,
I am using visual basic express 2008
1. How do I hardcode 2 ddns servers in vb.net? Or should i hardcode? can dns.gethostentry(dim host as string) resolve my domain without me specifying which dns server use to resolve?
2. I could not run my code successfully, below is the code.
Imports System.Net
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim host As IPHostEntry
Dim hostname As String = textbox1.text
host = Dns.GetHostEntry(hostname)
Dim fqdnAddress As String = host.AddressList(0).ToString()
TextBox2.Text = fqdnAddress
Catch ex As Exception
MsgBox("Unknown error")
Finally
End Try
End Sub
End Class
modified on Wednesday, September 10, 2008 2:55 PM
|
|
|
|
|
Hi
I ran the above code just now and it works!!
Anyway is there a way to implement a line of code upon user hitting the enter key the results will be displayed? Currently I must click on button1 to resolve the domain i entered.
|
|
|
|
|
Just a small tip for future coding endeavors then:
MsgBox(Ex.ToString) or MsgBox(Ex.Message) instead of MsgBox("Unknown error")
My advice is free, and you may get what you paid for.
|
|
|
|
|
Thanks.
I follow your suggestion, changed to msgbox(ex.message), when an invalid link or non-existent domain is entered, "No host found" message box will appear.
Can anyone tell me whether system.net.dns is capable of resolving host with hardcoded server?
i know how to hardcode dns server but do not know how to continue from here:
dim dnsServer1 as IPAddress = IPAddress("123.123.123.123")
Any suggestions or advice?
Thanks.
|
|
|
|
|
What is the best approach for showing logged events and data in a window, both in situations where data will always be available a line at a time, and in situations where it won't?
One approach is to use a text box with the 'readonly' property enabled, and keep shoving new text at the end. That approach is workable, but the only practical methods of adding data are to either do something like "myTextBox.Text = myTextBox.Text & newStuff", which gets very slow pretty quickly, or else to set the selection point to the end of the text and then do "myTextBox.SelectedText = newStuff", which works better but trashes the positions of the current selection and scroll.
Another approach is to use a listbox. This offers some advantages, in that a listbox can perform well with lots of data, and an owner-draw listbox can display data in a variety of nice formats. Unfortunately, a listbox does not provide any good way for people to copy text, nor does it provide any nice way I can find to scroll when new data is added if and only if the scroll position is set to the bottom. Further, I'm not aware of any way to force a listbox to recalculate the height of all the objects therein (e.g. in response to a resize event) other than by deleting and re-adding all of them (which would be needlessly slow, would require extra handling to maintain anything even remotely resembling the current scroll position, etc.)
Are there any better alternatives to those types of controls?
|
|
|
|
|
|
I hadn't thought about it for this application. The one time I tried using a ListView, I found it confusing and couldn't figure out what was going on. It does conceptually seem like a ListView might be able to do what I'm after, but it also seems complicated. I don't care about people being able to edit stuff in the log window, but select/copy would be nice.
The ListBox is in some ways pretty good; the biggest weaknesses are:
(1) I don't know any reasonable way to have it reformat when the control width changes (to allow wordwrap). Not a biggie, and would probably be complicated to make work nicely.
(2) I don't know how to make scrolling behave sensibly (e.g. when a new item is added, scroll if the last item was visible but the new item is not; when items have to be pruned from the start of the box (e.g. keeping the last 10,000 lines) maintain the same apparent scroll position unless items on the display are getting deleted.
(3) I don't know any nice way to allow text select/copy. Right now I'm using double-click as a shortcut to copy a line to the clipboard, but that's nonstandard and seems ugly.
Of those, I'd say #2 is the only one that seems really bothersome. Any ideas how to deal with it?
|
|
|
|
|
i have a function with two parameters , I want to start the thread and want to give the address of that function in the thread.Now my question is how should i pass that function in thread.
According to my understanding , i should create a class , there i would create two variables of same type that of parameter list of function , and a function which contains that fucntion implementation .and now create an instance of the class and pass that address in the thread.
This seems to be a very lengthy process.
Please help.
Thanks
|
|
|
|
|
Nilish wrote: This seems to be a very lengthy process.
Well, if you can't be bothered writing 6 lines of code, perhaps you're in the wrong business.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
what you did not like the answers you got last time clickety[^]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I am using e.Graphics.DrawImage(pb.BackgroundImage,dPoints) to print the contents of a picture box. My problem is the picture box is set to use ImageLayout.Tile and I want the tiled image to print. However, what actually prints is the untiled source image, not the background as it appears on screen. Any help appreciated.
|
|
|
|
|
Is it possible to do a 'sticky' "VB FAQ" topic for questions that get asked several times per week. Stuff like: How do I convert this C# code to vb?
If certain FAQ are more in-depth, then simply provide links to the corresponding codeproject articles, msdn, etc.
On a day to day basis, there are alot of good questions and ideas; but there's also quite a few topics that get asked almost daily because users aren't using the search.
Just putting it out there as a suggestion.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
FAQs have been written, and ignored, since this forum was created.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
The good questions generally get answered and the dumb ones get dumped on, there have been a number of suggestions (including FAQs) to alleviated the issues but an idiot is an idiot and no matter what Chris tries will still post an idiot question before either searching or thinking.
You learn to take a small pleasure in dumping on the idiots or ignoring them. I do notice that the level of idiocy tends to fluctuate quite dramatically.
Never underestimate the power of human stupidity
RAH
|
|
|
|