|
If it was the code I wrote I would have all of that done but all I am doing is calling a TableDataAdapter that is created from the .NET Dataset to fill the local datatable contained in my instance of that dataset.
As I said before, this was not an issue, I did not change anything and am now having to track it down. Here is the code where it breaks.
<br />
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _<br />
Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _<br />
Global.System.ComponentModel.DataObjectMethodAttribute(Global.System.ComponentModel.DataObjectMethodType.Fill, false)> _<br />
Public Overloads Overridable Function GetCustomerDetailsCustomerDetailID(ByVal dataTable As CustomerDetail.CustomerDetailsDataTable, ByVal CustomerDetailID As Global.System.Nullable(Of Integer)) As Integer<br />
Me.Adapter.SelectCommand = Me.CommandCollection(1)<br />
If (CustomerDetailID.HasValue = true) Then<br />
Me.Adapter.SelectCommand.Parameters(1).Value = CType(CustomerDetailID.Value,Integer)<br />
Else<br />
Me.Adapter.SelectCommand.Parameters(1).Value = Global.System.DBNull.Value<br />
End If<br />
If (Me.ClearBeforeFill = true) Then<br />
dataTable.Clear<br />
End If<br />
Dim returnValue As Integer = Me.Adapter.Fill(dataTable)<br />
Return returnValue<br />
End Function
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|
|
how can i delete a question i wrote?
|
|
|
|
|
Last of your post que.
ex:-
Reply,etc... [Edit/Delete]
|
|
|
|
|
i dont have these options
|
|
|
|
|
I think you are not the registered user, register yourself if not.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
There's nothing more annoying that people who delete their questions after they have been answered. What possible reason could you have to do that ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Christian Graus wrote: What possible reason could you have to do that ?
Realization that you have asked question in wrong forum or if you have got flamed or whatever.
Moreover, how does VB comes into picture here?
Loading signature. Please wait...
|
|
|
|
|
Hi,
I have this file
11,misc,0008,AMM /RUH /DMM(RJ),0023,18:00-24:00,0002,RJ ,00704,AMM ,RUH ,060331,2200,000,5,001286,003,175,-01,001,006,N,000,000,000,000,000,000,000,000,000,000,Y,N,000,000,000,000,000,000000000,000000000,000000000,000,000,000.00,000,000.00,000,000
13,J,J ,001,003,175,000,000,000,Y,001,Y,N,000.00,023,000,000,000,000,000,000,000,000,Non,0000.00,0000.00,000,000,000,000,000,000.00,000.00,000,000,001.00,000.00,000.00,000,000,000,000,000,000,000,000,000,000430,N,N,N,N,-01,100,000,000,006,000,100,000,000,000,000000,000,000,000,000,000,000,000,000,000286,000286,000430
14,J,J ,023,000,000,000,000,000,000,000,024,-01,000,000,000,000,000,000
13,J,U ,002,003,175,000,000,000,Y,001,N,Y,000.00,023,000,000,000,000,000,000,000,000,Non,0000.00,0000.00,000,000,000,000,000,000.00,000.00,000,000,001.00,000.00,000.00,000,000,000,000,000,000,000,000,000,000001,N,N,N,N,-01,100,000,000,006,000,100,000,000,000,000000,000,000,000,000,000,000,000,000,000001,000001,000001
14,J,U ,023,000,000,000,000,000,000,000,024,-01,000,000,000,000,000,000
12,J,003,175,000,Y,N,000.00,000,000,000,000,000,000,000,000,000,000,000,000,000.00,000.00,000,000,000.00,000.00,001.00,000,000,000,000,000,000,000,000,000,N,N,N,N,000000000,000000000,000000000,000000000,000000000,000,000,000,000,000
13,Y,Y ,003,003,175,000,000,000,Y,003,Y,N,000.00,023,000,000,000,000,000,000,000,000,Non,0000.00,0000.00,000,000,000,000,000,000.00,000.00,000,000,001.00,000.00,000.00,000,000,000,000,000,000,000,000,000,000375,N,N,N,N,-01,100,000,000,006,000,100,000,000,000,000000,000,000,000,000,000,000,000,000,000275,000275,000375
14,Y,Y ,023,000,000,000,000,000,000,000,024,-01,000,000,000,000,000,000
13,Y,S ,004,003,175,000,000,000,Y,003,N,N,000.00,023,000,000,000,000,000,000,000,000,Non,0000.00,0000.00,000,000,000,000,000,000.00,000.00,000,000,001.00,000.00,000.00,000,000,000,000,000,000,000,000,000,000253,N,N,N,N,-01,100,000,000,006,000,100,000,000,000,000000,000,000,000,000,000,000,000,000,000124,000124,000253
14,Y,S ,023,000,000,000,000,000,000,000,024,-01,000,000,000,000,000,000
13,Y,N ,005,003,175,000,000,000,Y,004,N,N,000.00,023,000,000,000,000,000,000,000,000,Non,0000.00,0000.00,000,000,000,000,000,000.00,000.00,000,000,001.00,000.00,000.00,000,000,000,000,000,000,000,000,000,000243,N,N,N,N,-01,100,000,000,006,000,100,000,000,000,000000,000,000,000,000,000,000,000,000,000207,000207,000243
14,Y,N ,023,000,000,000,000,000,000,000,024,-01,000,000,000,000,000,000
13,Y,M ,006,003,175,000,000,000,Y,005,N,N,000.00,023,000,000,000,000,000,000,000,000,Non,0000.00,0000.00,000,000,000,000,000,000.00,000.00,000,000,001.00,000.00,000.00,000,000,000,000,000,000,000,000,000,000227,N,N,N,N,-01,100,000,000,006,000,100,000,000,000,000000,000,000,000,000,000,000,000,000,000185,000185,000227
14,Y,M ,023,000,000,000,000,000,000,000,024,-01,000,000,000,000,000,000
13,Y,H ,007,003,175,000,000,000,Y,006,N,N,000.00,023,000,000,000,000,000,000,000,000,Non,0000.00,0000.00,000,000,000,000,000,000.00,000.00,000,000,001.00,000.00,000.00,000,000,000,000,000,000,000,000,000,000210,N,N,N,N,-01,100,000,000,006,000,100,000,000,000,000000,000,000,000,000,000,000,000,000,000111,000111,000210
14,Y,H ,023,000,000,000,000,000,000,000,024,-01,000,000,000,000,000,000
13,Y,B ,008,003,175,000,000,000,Y,007,N,N,000.00,023,000,000,000,000,000,000,000,000,Non,0000.00,0000.00,000,000,000,000,000,000.00,000.00,000,000,001.00,000.00,000.00,000,000,000,000,000,000,000,000,000,000190,N,N,N,N,-01,100,000,000,006,000,100,000,000,000,000000,000,000,000,000,000,000,000,000,000166,000166,000190
14,Y,B ,023,000,000,000,000,000,000,000,024,-01,000,000,000,000,000,000
13,Y,G ,011,003,175,000,000,000,Y,010,N,Y,000.00,023,000,000,000,000,000,000,000,000,Non,0000.00,0000.00,000,000,000,000,000,000.00,000.00,000,000,001.00,000.00,000.00,000,000,000,000,000,000,000,000,000,000001,N,N,N,N,-01,100,000,000,006,000,100,000,000,000,000000,000,000,000,000,000,000,000,000,000001,000001,000001
14,Y,G ,023,000,000,000,000,000,000,000,024,-01,000,000,000,000,000,000
13,Y,V ,012,003,175,000,000,000,Y,011,N,N,000.00,023,000,000,000,000,000,000,000,000,Non,0000.00,0000.00,000,000,000,000,000,000.00,000.00,000,000,001.00,000.00,000.00,000,000,000,000,000,000,000,000,000,000170,N,N,N,N,-01,100,000,000,006,000,100,000,000,000,000000,000,000,000,000,000,000,000,000,000106,000106,000170
14,Y,V ,023,000,000,000,000,000,000,000,024,-01,000,000,000,000,000,000
13,Y,X ,013,003,175,000,000,000,Y,012,N,Y,000.00,023,000,000,000,000,000,000,000,000,Non,0000.00,0000.00,000,000,000,000,000,000.00,000.00,000,000,001.00,000.00,000.00,000,000,000,000,000,000,000,000,000,000001,N,N,N,N,-01,100,000,000,006,000,100,000,000,000,000000,000,000,000,000,000,000,000,000,000001,000001,000001
14,Y,X ,023,000,000,000,000,000,000,000,024,-01,000,000,000,000,000,000
14,Y,T ,023,000,000,000,000,000,000,000,024,-01,000,000,000,000,000,000
12,Y,003,175,000,Y,N,000.00,000,000,000,000,000,000,000,000,000,000,000,000,000.00,000.00,000,000,000.00,000.00,0
i need to read the lines that start with 11 first, then the ones that starts with 12, then 13 and ignore 14...
i started with this code:
'Using MyReader As New Microsoft.VisualBasic.FileIO.TextFieldParser("C:\hi.txt")
' MyReader.TextFieldType = FileIO.FieldType.Delimited
' MyReader.CommentTokens = New String() {"14"}
' MyReader.SetDelimiters(",")
' Dim currentRow As String()
' Dim test As String = ""
' While Not MyReader.EndOfData
' currentRow = MyReader.ReadFields()
' Dim currentField As String
' For Each currentField In currentRow
'
' test &= currentField & " "
' TextBox2.Text = test
'
' End If
' Next
' End While
'End Using
can anyone help me?
|
|
|
|
|
Hi,
You can read this file in to one temperary dataset and datatable.
By checking the values in the cells you can read whichever row you want.
This is one easiest way, may be if you can find any more effective ways to
do it for improving performance do little much research.
But the easiest way is which I have shown you.
Thanks a Lot,
Aleem Mohammad.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
i wanna read them so i can insert them in a database starting with lines 11, then insert 12 , then 13
|
|
|
|
|
Unless you need data from lines starting 11 to use in lines starting 12 etc then there is no need to read them in a specific order - when you retrieve the data from the database do an order by. That is one of the advantages of a database.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Actually i need data from 11 to use in 12, the whole idea is to read line 11 insert it into database, then insert the 12 related to that 11 into database, then the 13 that are related to them
|
|
|
|
|
In which case why not read the entire file and store the different record types in (say) dictionaries so you can jus use them as required.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Why not read them all with file.readalllines, then build a map of lists of strings and thus sort them according to the sets you're after, and then work through those lists ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
You could try something like this.
The example data could be interpreted as
(a) a set of files where each file contains one 11 record,
or (b) one file that has multiple 11 records with each one followed by 12, 13 and 14 records.
I assume the latter.
Imports System
Imports System.Text
Imports System.IO
module CSVReader
public Sub Main()
Dim theFile As String = "C:\PlayPen\TheData.txt"
Dim rdr As StreamReader = new StreamReader(theFile)
Using (rdr)
Dim theKey As String = ""
Dim input As String
Dim recType As String
while (rdr.Peek >= 0)
input = rdr.ReadLine() 'Should check that not a blank line
Dim recArray As String() 'if there is one then following fails
recArray = input.Split(",")
recType = recArray(0)
Select Case(recType)
case "11":
theKey = recArray(1) 'Need to change this to get type 11 key
Process11(input)
case "12":
Process12(theKey, input)
case "13":
Process13(theKey, input)
case "14":
Process14(theKey, input)
case else
Console.WriteLine("Oops: {0}", input)
End Select
End While
End Using
End Sub
private Sub Process11(rec As String)
Console.WriteLine("Proc11 {0}",rec)
End Sub
private Sub Process12(key11 As String, rec As String)
Console.WriteLine("Proc12 key = {0}: {1}", key11, rec)
End Sub
private Sub Process13(key11 As String, rec As String)
Console.WriteLine("Proc13 key = {0}: {1}", key11, rec)
End Sub
private Sub Process14(key11 As String, rec As String)
Console.WriteLine("Proc14 key = {0}: {1}", key11, rec)
End Sub
End Module
The text file I used to test this is as follows:
11,one,xyz
13,abc_one,xyz
12,aaa_one,xyz
14,bad_one,xyz
13,abc_one,xyz
12,aaa_one,xyz
11,two,xyz
13,abc_two,xyz
14,bad_two,xyz
13,abc_two,xyz
14,bad_two,xyz
14,bad_two,xyz
13,abc_two,xyz
13,abc_two,xyz
14,bad_two,xyz
11,three,xyz
12,aaa_three,xyz
13,abc_three,xyz
11,four,xyz
14,bad_four,xyz
12,aaa_four,xyz
13,abc_four,xyz
11,five,xyz
12,aaa_five,xyz
12,aaa_five,xyz
14,bad_five,xyz
14,bad_five,xyz
14,bad_five,xyz
14,bad_five,xyz
13,abc_five,xyz
13,abc_five,xyz
11,six,xyz
12,aaa_six,xyz
Obviously your data has more fields but the general technique should work.
|
|
|
|
|
|
Hmmm!
Not sure from your reply whether this was helpful or not.
From your original post it looked like you needed to process a text file with type 11 records followed by other types in no particular order. I just used some standard 'Control-Break' type processing that is well known to COBOL programmers (though some of them would not like the Select Case - particularly those brought up on Jackson Structured Programming!)
|
|
|
|
|
Hi,
I want to understand the compilation and runnung techniques of VB. I am .Net programmer, have been assigned with some small VB task.
I am frequently strucking up because of lack of understanding VB and its compilation and running techniques(IDE).
For example, there is one project which I have added in to my application and want to use it.
When I compile it, it is compiling but when I run it it is saying compilation error "User-defined type not defined".
When I added a library and tried for running the application then I got the following message "No creatable public component detected"
I am unable to follow this, so please anybody can provide me some hints or links to better understand the VB 6.0 IDE, so that atleast I can run any given code.
Because I am not strucking up at code, I am understanding the code very well but strucking up at the small techniques.
Please can any body help me in overcoming this. I would be very much thankfull.
Thanks a Lot,
Aleem Mohammad.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
modified on Tuesday, November 25, 2008 2:30 AM
|
|
|
|
|
Oh, you're stuck in VB6 hell. That really sucks. VB6 has been dead for some time.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi Christian,
How are u, after a long time we met. Its fine everything here, how is everything going on there?
If possible can u please me in this.
Aleem Mohammad.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
*grin* hi
I'm sorry, I never use VB6. I started to reply b.c I thought it was a VB.NET question, then I realised half way through it was VB6. You were less than clear on this. VB6 is, as I said, dead, defunct and crap. You should put VB6 in your subject line to attract an answer from the handful of people still using it.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
to attract an answer from the handful of people still using it.
Sorry
You should put VB6 in your subject line.
Thanks I will follow it.
Aleem Mohammad.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
Christian Graus wrote: put VB6 in your subject line to attract an answer from the handful of people still using it
I agree.
Christian Graus wrote: I never use VB6
Same here, and glad I never had to
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
indian143 wrote: When I compile it, it is compiling but when I run it it is saying compilation error "User-defined type not defined".
Go to references and correct all references which has a "MISSING" prefix.
|
|
|
|
|
Hi,
I am trying like that, but some times it doesnt show the "Missing" prefix. Still I am trying one by one.
Thanks,
Aleem Mohammad.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|