Click here to Skip to main content
15,877,103 members
Home / Discussions / C#
   

C#

 
AnswerRe: RegEx Pin
OriginalGriff6-May-10 23:54
mveOriginalGriff6-May-10 23:54 
GeneralRe: RegEx Pin
Paul Unsworth6-May-10 23:57
Paul Unsworth6-May-10 23:57 
GeneralRe: RegEx Pin
OriginalGriff7-May-10 0:12
mveOriginalGriff7-May-10 0:12 
AnswerRe: RegEx Pin
OriginalGriff6-May-10 23:57
mveOriginalGriff6-May-10 23:57 
GeneralRe: RegEx Pin
Paul Unsworth7-May-10 0:00
Paul Unsworth7-May-10 0:00 
QuestionGenerate Sequencial Number Pin
Zoomlion6-May-10 22:44
Zoomlion6-May-10 22:44 
AnswerRe: Generate Sequencial Number Pin
OriginalGriff6-May-10 22:47
mveOriginalGriff6-May-10 22:47 
GeneralRe: Generate Sequencial Number Pin
Zoomlion6-May-10 23:03
Zoomlion6-May-10 23:03 
I have something similar in VB6 with MDB but have difficulty using C# and MSS. See my VB6 code below and advice on how to produce something similar in C#.
Public Sub GenerateCode(ByRef Coder As String)
Dim strMar As String, intApr As Integer
Dim strJul As String
Coder = UCase(Coder)

Dim rs As New ADODB.Recordset
Dim cn As New ADODB.Connection
On Error GoTo AddNewErr
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Manager.mdb"
rs.Open "select ItemNo from Items where left(ItemNo,8) like '" + Coder + "' order by ItemNo asc", cn, adOpenKeyset, adLockOptimistic

If rs.RecordCount <> 0 Then
rs.MoveLast
If Left(Trim(rs.Fields!ItemNo), 8) = Coder Then
strMar = Right(Trim(rs.Fields!ItemNo), 6)
strMar = Val(strMar) + 1
strMar = CStr(strMar)
If (6 - Len(strMar)) <> 0 Then
strMar = String$(6 - Len(strMar), "00000") & strMar
End If
Else
strMar = "000001"
End If
Else
strMar = "000001"
End If
Coder = Coder & strMar
Editor = Coder
Set rs = Nothing
Set cn = Nothing
Exit Sub
AddNewErr:
MsgBox Err.Description, vbExclamation, "Error Report"

End Sub
GeneralRe: Generate Sequencial Number Pin
OriginalGriff6-May-10 23:25
mveOriginalGriff6-May-10 23:25 
GeneralRe: Generate Sequencial Number Pin
Luc Pattyn7-May-10 2:15
sitebuilderLuc Pattyn7-May-10 2:15 
GeneralRe: Generate Sequencial Number Pin
OriginalGriff7-May-10 4:02
mveOriginalGriff7-May-10 4:02 
AnswerRe: Generate Sequencial Number Pin
nagendrathecoder6-May-10 23:04
nagendrathecoder6-May-10 23:04 
AnswerRe: Generate Sequencial Number Pin
Peace ON6-May-10 23:05
Peace ON6-May-10 23:05 
AnswerRe: Generate Sequencial Number Pin
Peace ON6-May-10 23:22
Peace ON6-May-10 23:22 
AnswerRe: Generate Sequencial Number Pin
#realJSOP6-May-10 23:25
mve#realJSOP6-May-10 23:25 
QuestionGenerate Error While Build Dll Pin
Anubhava Dimri6-May-10 21:29
Anubhava Dimri6-May-10 21:29 
AnswerRe: Generate Error While Build Dll Pin
Bernhard Hiller6-May-10 21:40
Bernhard Hiller6-May-10 21:40 
GeneralRe: Generate Error While Build Dll Pin
Anubhava Dimri6-May-10 21:43
Anubhava Dimri6-May-10 21:43 
GeneralRe: Generate Error While Build Dll Pin
Vimalsoft(Pty) Ltd6-May-10 21:56
professionalVimalsoft(Pty) Ltd6-May-10 21:56 
GeneralRe: Generate Error While Build Dll Pin
Anubhava Dimri6-May-10 22:16
Anubhava Dimri6-May-10 22:16 
GeneralRe: Generate Error While Build Dll Pin
Vimalsoft(Pty) Ltd6-May-10 22:31
professionalVimalsoft(Pty) Ltd6-May-10 22:31 
QuestionDataSet to List<> Pin
Illegal Operation6-May-10 17:43
Illegal Operation6-May-10 17:43 
AnswerRe: DataSet to List Pin
Luc Pattyn6-May-10 17:51
sitebuilderLuc Pattyn6-May-10 17:51 
GeneralRe: DataSet to List Pin
Illegal Operation6-May-10 17:55
Illegal Operation6-May-10 17:55 
GeneralRe: DataSet to List Pin
Luc Pattyn6-May-10 18:06
sitebuilderLuc Pattyn6-May-10 18:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.