|
Could you clarify the issue of getting the number from the text file and looking up other numbers from it? Do all of the four numbers look up an id from the same table or different tables? It sounds like it might be possible to do this with a clever SQL statement, but without more information I can't help you.
Another thing, it sounds like after you get all of your data you insert all 20,000-30,000 rows individually. I think it would be faster to input all of the data into a DataTable and use a DataAdapter to update all of the rows in one step.
|
|
|
|
|
Sorry for late reply...
Let me clarify all more clear.
Could you clarify the issue of getting the number from the text file and looking up other numbers from it?
Ans: Actually i am having one text file,now there are one column which stores information like a unique number :
example: ABC1234A12B243C334 Now from this type of number i have to slip this number like ABC1234 and find that number in one table in db get the according id of that which return 1222 for that row,store this value some where,Now go to another number of same full number that is A12 and find the id from table (yeh definatly all the tables are different not from same table) then store this value somewhere and go on for this number "B243"
and find Id from another table and store value somewhere do same thing upto end of the same number (till C334).
Tables are different not same.
I have to do the same thing for 20,000-30000 rows of that text file.
If i do one by one than it takes lots of time becoz in that case i have to take like 20,000-30,000 connection on that time appication may hang up.
Once i get all the values(i.e. all the ids) need to insert into one table.
Can you pls. tell me that how to do bulk insertion??
montu3377
|
|
|
|
|
HIE,
I 'm making a address book type application and i need to add an export to word function.I want to be able to write data into a table in a word file.Is this possible and how would i go about it?? if it is possible??
I had a wierd idea .. what if i made the table in a richtextbox (i dont know how to do that~!)And then write that data into a .doc file?.
also what about just printing the table .. what do i have to look up to just make a File->Print fuction that would have the table printed!??
i really need this please , this is the third forum i've put this question on!!
PS . i need to know how to do this in VB6 code cuz.. i'm still not very clear with .NET concepts!
Thanks
Gideon
-- modified at 13:25 Friday 14th July, 2006
|
|
|
|
|
Hallo all,
first sorry for my English.
I have a problem. I build an good aplication with a form. In this i show my college some interesting details as text in an label. They only must press a button every have an hour an see the new informations. So i take this informations from an automatik create info.txt file.. I think with the filewatcher i can show it every half an hour automaticly in the lbinfo label in form1 but there come everytime this error:
Its look in German sorry .
Fehler beim Erstellen des Formulars. Weitere Informationen finden Sie in Exception.InnerException. Fehler: Für den aktuellen Thread muss der STA-Modus (Single Thread Apartment) festgelegt werden, bevor OLE-Aufrufe ausgeführt werden können. Stellen Sie sicher, dass die Hauptfunktion mit STAThreadAttribute gekennzeichnet ist .
This is my code for working:
so its easiere to understand?
Imports System.IO
Module Watchertest
Sub Run()
' Create a new FileSystemWatcher and set its properties.
Dim watcher As New FileSystemWatcher()
watcher.Path = ("c:\sms\")
' Only watch text files.
watcher.Filter = "sms.txt"
' Add event handlers.
AddHandler watcher.Created, AddressOf OnChanged
' Begin watching.
watcher.EnableRaisingEvents = True
End Sub
' Define the event handlers.
Sub OnChanged(ByVal source As Object, ByVal e As FileSystemEventArgs)
' Specify what is done when a file is changed, created, or deleted.
MsgBox("File: " & e.FullPath & " " & e.ChangeType)
FrmSms.Cursor = Cursors.WaitCursor
FrmSms.TxtMis.Text = Nothing
Call Mis_Sql_connect.sql_con()
FrmSms.TxtMis.Visible = True
FrmSms.TxtMis.Text = Trim(info)
FrmSms.Cursor = Cursors.Default
End Sub
End Module
Thanks for help.
Regards Thomas
|
|
|
|
|
Sorry, but your posted message is very hard to understand. And I'm confused about your code. How is the Run() method called or by what control? What type of VB are you using? Perhaps it is my own limited knowledge, but I really don't understand the AddHandler code you are using.
Perhaps you should think about using a timer control. That way you can check the file every half hour without the user pressing a button.
For anyone else who is trying to help, I used an online translator to translate the error message to english and got this:
Error with providing the form. Further information finds you in exception inside exception. Error: For the current Thread the STA mode (single Thread apartment) must be specified, before OLE calls can be implemented. Guarantee that the main function is marked by STAThreadAttribute.
Perhaps you can use some break points/debugging methods to pin point exactly where the error is occuring.
Sorry I couldn't help you more.
|
|
|
|
|
Hallo thanks for answere. First the txt file not look every half an hour exectly so i want do this with the watcher. My vb is VB2005 netframework2.
In this Code i look for change filter on the sms.txt file. Then i have an Frmsms its look informations about the productivity of some works. I want only refresh the label in this Form and the translated message from you is correct. If the txt changed a msgbox is popup i have test it.Thats all correct by the handle but if i do refresh or do anything outside this class (frmsms.label5.refresh) or else the error is pop up..
I look to command my code and post nearly.
Thanks Thomas
|
|
|
|
|
Sorry, but this doesn't help. We still can't understand a thing you said.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi everyone,
I have this application that I need to actually restart it because I have so many things to reset and I can't identify all of them to reset them one by one. So I thought of using Application.Restart and it works but the blinking of the interface seems a little annoying.
I was thinking is there any better way to do it other than making another identical interface on top of it? So that the user would not know it is being restart.
Thanks
J Liang
|
|
|
|
|
Not really. You've got 4 options...
1) Use Application.Restart
2) Launch a new copy of your application, and probably get the same effect as #1
3) Reset everything that needs to be reset, one thing at a time.
4) Move as much data as you can, that needs to be reset, into it's own seperate class, then serialize the "just initialized" state of this class out to a file. When you need to restart, just reload the data.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
First, with a cold restart, blinking seems to be inevitable. However, it's difficult to re-initialize the running application to its startinf state without a restart. Actually, GUI is not the most difficult part; the system state is.
The approach we often adopt is save/restore or snapshot. The original idea is that during training, the trainee often want to take a snapshot and save it to a disk file. Next time, when you run the app again, you could load that snapshot and restore to the system state when the snapshot was taken. We also find the snapshot is handy when we want to re-initialize the application without restarting, which I call "hot restart". But usually, it is not trivial to implement a snapshot capability.
Best,
Jun
|
|
|
|
|
Hi
How to filter record in dataset and update those filtered records
Thanks in advance
|
|
|
|
|
'** Creat a dataview of the table in the dataset
Dim tableView As DataView = New DataView(dataSet.Tables("TableName"))
'** Filter the dataview to isolate the one row being updated
Dim sb As New StringBuilder
With sb
.Length = 0
.Append("TableColumnName")
.Append("= '")
.Append("ValueOfData")
.Append("'")
tableView.RowFilter = .ToString
End With
sb = Nothing
'** Do the update
If tableView.Count > 0 Then
'** Create a view of the row being updated
Dim tr As DataRowView
tr = tableView.Item(0)
'** Update the columns being changed
tr.Item("NameOfColumnBeingChanged") = "NewValue"
tr = Nothing
End If
tableView = Nothing
|
|
|
|
|
I have one font required in my project . which I dont want to install on the client infact it should be some where in my Resource files and I should use it from there.
Any ideas or suggestions
Regards
Rizwan Bashir
|
|
|
|
|
Hi all,
I'm having trouble editing the atrribute "member" of a group. I can extract all the information but can't add or remove anything. It's a Win2003 Server/DC, I have the rights to add/remove.
I'm using VB .net 2005
My Code:
oSearcher.Filter = "(&(objectClass=group)(cn="something..."))"
oSearcher.SearchScope = System.DirectoryServices.SearchScope.Subtree
oSearcher.PropertiesToLoad.Add("member")
oResult = oSearcher.FindOne
oResult.GetDirectoryEntry.Properties("member").Remove(something...)
oResult.GetDirectoryEntry.CommitChanges()
Is there an error in the code? What ist the better way to go: to use "Invoke" or the "Properties"? What's the difference? Is there any way to get a response if the add/remove didn't work (eg don't have the rights or wrong group name...)? I need to get this done by Monday so pleeeeeaaase help!
Regards,
Uli
-- modified at 6:27 Friday 14th July, 2006
|
|
|
|
|
I figured it out myself.
The problem was that I was trying to edit the oResult Object which doesn't work!
oResult = oSearcher.FindOne
Dim deObject as DirectoryEntry
deObject=oResult.GetDirectoryEntry
deObject.Properties("member").Remove(something...)
deObject.CommitChanges()
That's all.
Hope this helps someone.
Uli
|
|
|
|
|
hellow to all
i am trying to build my own Custom Control that Inherits from AxMSMask.AxMaskEdBox .
i wanna do simple thing i wanna have some property that when i make it ture it will run function every time that the user leave the MaskedBox it will run .
i started writing my own code , but i code stucked i didn't found good stuff anyone can help me with the following code ? , or give me links to related issues ?
Imports System.ComponentModel
Public Class MskTextBox
Inherits AxMSMask.AxMaskEdBox
Private DateStr As Boolean
Public Property DateValidator() As Boolean
Get
DateValidator = DateStr
End Get
Set(ByVal Value As Boolean)
DateStr = Value
End Set
End Property
Private Sub MskTextBox(ByVal Datestr As AxMSMask.AxMaskEdBox)
If Not IsDate(Datestr.FormattedText) Then
MessageBox.Show("error ! ")
End If
End Sub
End Class
|
|
|
|
|
Is there is specific problem you are having with your code?
|
|
|
|
|
I have developed project on VB6.0 and Database backend in SQL Server
more than 30 user are use this software in at time. They are not faced any problem the s/w working fine but as soon as the no. of user are increased we are
faced process Id problem Plz Help me
Process ID problem means There was error as dead processId of sql server
-- modified at 9:00 Friday 14th July, 2006
|
|
|
|
|
Sinchan Nikam wrote: but as soon as the no. of user are increased we are
faced process Id problem
What do you mean by "a process Id problem"?? There's not enough information here to figure out what your talking about let alone what the problem is.
The EXACT, word-for-word, error message would help greatly!
Dave Kreskowiak
Microsoft MVP - Visual Basic
-- modified at 9:53 Friday 14th July, 2006
|
|
|
|
|
If it's the error that I THINK you're getting, you might want to look at Troubleshooting Deadlocks[^] in the SQL Server documentation.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Please help me how to set the connection pulling in VB6.0
|
|
|
|
|
Sinchan Nikam wrote: Please help me how to set the connection pulling in VB6.0
"Connection pulling"?? What do you mean by this?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I'm assuming he means connection pooling
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
|
So am I, but I've been wrong before!
I'm actually looking for why he thinks he needs to "turn it on"...
Dave Kreskowiak
Microsoft MVP - Visual Basic
-- modified at 9:47 Friday 14th July, 2006
|
|
|
|
|
I need my program to do the following things in this order:
Find all the CDROM Drives on a computer
Determine which CDROM Drive contains a certain CD (i.e. My Stuff)
Find a file on that cd ( i.e. Setup)
Run that file
thankyou in advance
Im using VB.NET Express Edition and i am only a self taught amateur.
Posted by The ANZAC
-- modified at 6:56 Friday 14th July, 2006
|
|
|
|