Click here to Skip to main content
15,891,864 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Connect MySQL Database in Linux PC by VB.NET Pin
Bernhard Hiller13-Nov-13 21:05
Bernhard Hiller13-Nov-13 21:05 
Questionvoting system based on image steganography Pin
fizie896-Nov-13 6:38
fizie896-Nov-13 6:38 
AnswerRe: voting system based on image steganography Pin
Richard MacCutchan6-Nov-13 9:06
mveRichard MacCutchan6-Nov-13 9:06 
AnswerRe: voting system based on image steganography Pin
Mycroft Holmes6-Nov-13 12:00
professionalMycroft Holmes6-Nov-13 12:00 
QuestionStill The problem not solved regarding the edit button column. Pin
Member 101928355-Nov-13 20:40
Member 101928355-Nov-13 20:40 
QuestionRe: Still The problem not solved regarding the edit button column. Pin
Richard MacCutchan5-Nov-13 21:40
mveRichard MacCutchan5-Nov-13 21:40 
AnswerRe: Still The problem not solved regarding the edit button column. Pin
Member 101928355-Nov-13 22:11
Member 101928355-Nov-13 22:11 
AnswerRe: Still The problem not solved regarding the edit button column. Pin
Member 101928355-Nov-13 22:17
Member 101928355-Nov-13 22:17 
Dear Sir,
First of all,Thank you so much for your kind endevour to make the code right, it's working when i click on the edit button the selected record shows in the text box and clicking on the delete button it' working properly, but one thing is here , I change my code as you send to me but when I update the record and click on save button , the new record is added with update text box not updated the existing record, I am sending following my save button click event,
 

Private Sub btnsave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsave.Click
       If validateform() Then
           If id IsNot Nothing Then
 
               Dim result As Boolean = lbll.updatelorry(txtLcode.Text.Trim(), txtLno.Text.Trim(), txtDname.Text.Trim())
               If result = True Then
                   ClearText()
                   bindgrid()
                   id = Nothing
                   MessageBox.Show("Update Successfully")
 
               End If
           Else
               Dim result As Boolean = lbll.insertlorry(txtLcode.Text.Trim(), txtLno.Text.Trim(), txtDname.Text.Trim())
               If result = True Then
                   ClearText()
                   bindgrid()
                   MessageBox.Show("Created Successfully")
               End If
           End If
       End If
   End Sub

 
I have changed the "idstring" to id" which is used by you in my whole coding.one thing is there that in save button click event I have written that (if id isNoting) then proceed the update command. At this stage I already added the code "if id =0" cause he editbutton.index is 0, but it's not working throw message i.e

The method or operation is not implemented.

where as I am using the Function update.which is below
 

Public Function updatelorry(ByVal pkId As Integer, ByVal Lcode As String, ByVal Lno As String, ByVal Dname As String) As Boolean
            Try
                Dim param As SqlParameter() = New SqlParameter(3) {}
                param(0) = New SqlParameter("@pkid", pkId)
                param(1) = New SqlParameter("@lcode", Lcode)
                param(2) = New SqlParameter("@lno", Lno)
                param(3) = New SqlParameter("@dname", Dname)
                SqlHelper.ExecuteNonQuery(ConnectionString, CommandType.StoredProcedure, "updatelorry", param)
                Return True
            Catch
                Throw
            End Try
        End Function

also it makes automatic another update function where the message throws which is below

Function updatelorry(ByVal p1 As String, ByVal p2 As String, ByVal p3 As String) As Boolean
           Throw New NotImplementedException--error shows here
 
       End Function

 
when i use in save button click event that
if id=editbutton.index then the same message throw.
 
Please suggest me what to do at this stage to make the update procedure active.
 
also if i use comment in the automatic created function then it shows another error is that
"Argument not specified for parameter 'Dname' of 'Public Function updatelorry(pkId As Integer, Lcode As String, Lno As String, Dname As String) As Boolean'.at save button click event
 

Private Sub btnsave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsave.Click
       If validateform() Then
           'If id IsNot Nothing Then
           If id = editbutton.Index Then
 
               Dim result As Boolean = lbll.updatelorry(txtLcode.Text.Trim(), txtLno.Text.Trim(), txtDname.Text.Trim())--Error Shows here
               If result = True Then
                   ClearText()
                   bindgrid()
                   id = Nothing
                   MessageBox.Show("Update Successfully")
 
               End If
           Else
               Dim result As Boolean = lbll.insertlorry(txtLcode.Text.Trim(), txtLno.Text.Trim(), txtDname.Text.Trim())
               If result = True Then
                   ClearText()
                   bindgrid()
                   MessageBox.Show("Created Successfully")
               End If
           End If
       End If
   End Sub

 
the stored procedure od update command is
 

ALTER PROCEDURE [dbo].[updatelorry]
@lcode varchar(50),
@lno varchar(50),
@dname varchar(50),
@pkId int
AS
BEGIN
	update lorrymaster set LCode=@lcode,Lno=@lno,Dname=@dname
	where pkid=@pkId
	select  @pkId
END

 
Also the lorrymaster table structure is
 

CREATE TABLE [dbo].[lorrymaster](
    [pkid] [int] IDENTITY(1,1) NOT NULL,
    [lcode] [varchar](50) NULL,
    [lno] [varchar](50) NULL,
    [dname] [varchar](50) NULL,
    [createdate] [smalldatetime] NULL
) ON [PRIMARY]
 
GO
SET ANSI_PADDING OFF

GeneralRe: Still The problem not solved regarding the edit button column. Pin
Mycroft Holmes5-Nov-13 23:40
professionalMycroft Holmes5-Nov-13 23:40 
GeneralRe: Still The problem not solved regarding the edit button column. Pin
Member 1019283527-Nov-13 23:14
Member 1019283527-Nov-13 23:14 
Questionvb6 how to identify windows 8.1 Pin
MikeD 24-Nov-13 7:31
MikeD 24-Nov-13 7:31 
AnswerRe: vb6 how to identify windows 8.1 Pin
Mycroft Holmes4-Nov-13 11:48
professionalMycroft Holmes4-Nov-13 11:48 
AnswerRe: vb6 how to identify windows 8.1 Pin
MikeD 24-Nov-13 22:57
MikeD 24-Nov-13 22:57 
GeneralRe: vb6 how to identify windows 8.1 Pin
Mycroft Holmes4-Nov-13 23:54
professionalMycroft Holmes4-Nov-13 23:54 
GeneralRe: vb6 how to identify windows 8.1 Pin
Bernhard Hiller6-Nov-13 3:21
Bernhard Hiller6-Nov-13 3:21 
AnswerRe: vb6 how to identify windows 8.1 Pin
TnTinMn5-Nov-13 13:11
TnTinMn5-Nov-13 13:11 
GeneralRe: vb6 how to identify windows 8.1 Pin
MikeD 26-Nov-13 1:00
MikeD 26-Nov-13 1:00 
Questionhello Pin
fatemehbahranian3-Nov-13 19:46
fatemehbahranian3-Nov-13 19:46 
AnswerRe: hello Pin
Mycroft Holmes3-Nov-13 20:12
professionalMycroft Holmes3-Nov-13 20:12 
GeneralRe: hello Pin
GuyThiebaut5-Nov-13 4:47
professionalGuyThiebaut5-Nov-13 4:47 
GeneralRe: hello Pin
Mycroft Holmes5-Nov-13 11:32
professionalMycroft Holmes5-Nov-13 11:32 
QuestionMVVM WPF Datatable to Datagrid binding issue Pin
Member 98926063-Nov-13 8:07
Member 98926063-Nov-13 8:07 
AnswerRe: MVVM WPF Datatable to Datagrid binding issue Pin
Mycroft Holmes3-Nov-13 12:09
professionalMycroft Holmes3-Nov-13 12:09 
QuestionHow to make an ad blocker for web browser? Pin
AdvantageSoft31-Oct-13 13:05
AdvantageSoft31-Oct-13 13:05 
AnswerRe: How to make an ad blocker for web browser? Pin
Eddy Vluggen1-Nov-13 7:23
professionalEddy Vluggen1-Nov-13 7:23 

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.