Click here to Skip to main content
15,905,563 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionAdding unmanged code to VB.NET Pin
Nanda160523-Oct-08 0:39
Nanda160523-Oct-08 0:39 
AnswerRe: Adding unmanged code to VB.NET Pin
jzonthemtn23-Oct-08 1:11
jzonthemtn23-Oct-08 1:11 
GeneralRe: Adding unmanged code to VB.NET Pin
Nanda160523-Oct-08 1:53
Nanda160523-Oct-08 1:53 
GeneralRe: Adding unmanged code to VB.NET Pin
Dave Kreskowiak23-Oct-08 2:02
mveDave Kreskowiak23-Oct-08 2:02 
GeneralRe: Adding unmanged code to VB.NET Pin
Nanda160523-Oct-08 2:13
Nanda160523-Oct-08 2:13 
GeneralRe: Adding unmanged code to VB.NET Pin
Dave Kreskowiak23-Oct-08 3:53
mveDave Kreskowiak23-Oct-08 3:53 
Questionusing store procedure to insert selected checkboxlist values into database Pin
Mamphekgo Bahula22-Oct-08 21:55
Mamphekgo Bahula22-Oct-08 21:55 
AnswerRe: using store procedure to insert selected checkboxlist values into database Pin
TheComputerMan22-Oct-08 23:39
TheComputerMan22-Oct-08 23:39 
Hi, I have never used add with value but I assume it adds the parameter to the collection as well as adding the value. Try using .value =

Even if that worked you would still only get one 'set'passed through as your loops are replacing the value each iteration. Your executenonquery needs to be inside the loop, and the loop needs to add each type of value to the set.

Looking at what you are trying to do I suspect that you should be normalising the database a bit more, unless you want each row to contain the employee and client data for each service ID and region ID

Sort of like: (I don't think this is quite right as I an not sure what you controls are but you should get the idea)

cmdStandby.CommandText = "SaveAdmin"
cmdStandby.CommandType = CommandType.StoredProcedure
cmdStandby.Connection = sqlstandby


cmdStandby.Parameters.Add("@Perno", SqlDbType.Int)
cmdStandby.Parameters.Add("@Client_id", SqlDbType.Int)
cmdStandby.Parameters.Add("@Region_id", SqlDbType.Int)
cmdStandby.Parameters.Add("@Service_id", SqlDbType.Int)


For Each li In ChkRegion.CheckedItems

    cmdStandby.Parameters("@Perno").Value = CINT(lblEmpNo.Text)  'or the proper conversion
    cmdStandby.Parameters("@Client_id").Value = ddlClient1.SelectedValue	'or should this be selected index? If value what is it ? Text, integer etc
    cmdStandby.Parameters("@Region_id").Value = li.Value '(?)
    cmdStandby.Parameters("@Service_id").Value = li.Value '(?)
    cmdStandby.ExecuteNonQuery()

Next


For Each li In ChkService.CheckedItems

    cmdStandby.Parameters("@Perno").Value = CINT(lblEmpNo.Text)  'or the proper conversion
    cmdStandby.Parameters("@Client_id").Value = ddlClient1.SelectedValue
    cmdStandby.Parameters("@Region_id").Value = li.Value '(?)
    cmdStandby.Parameters("@Service_id").Value = li.Value '(?)
    cmdStandby.ExecuteNonQuery()

Next

AnswerRe: using store procedure to insert selected checkboxlist values into database Pin
Dave Kreskowiak23-Oct-08 2:01
mveDave Kreskowiak23-Oct-08 2:01 
QuestionSFTP activex? Pin
hatemtaleb22-Oct-08 21:27
hatemtaleb22-Oct-08 21:27 
AnswerRe: SFTP activex? Pin
Dave Kreskowiak23-Oct-08 7:18
mveDave Kreskowiak23-Oct-08 7:18 
QuestionVariables.. Pin
Subjugate22-Oct-08 17:34
Subjugate22-Oct-08 17:34 
AnswerRe: Variables.. Pin
Rupesh Kumar Swami22-Oct-08 20:42
Rupesh Kumar Swami22-Oct-08 20:42 
AnswerRe: Variables.. Pin
Jon_Boy23-Oct-08 2:55
Jon_Boy23-Oct-08 2:55 
QuestionProblem with Drag & Drop between list boxes Pin
TheComputerMan22-Oct-08 12:38
TheComputerMan22-Oct-08 12:38 
AnswerRe: Problem with Drag & Drop between list boxes Pin
sumit703422-Oct-08 22:47
sumit703422-Oct-08 22:47 
GeneralRe: Problem with Drag & Drop between list boxes Pin
TheComputerMan22-Oct-08 23:01
TheComputerMan22-Oct-08 23:01 
GeneralRe: Problem with Drag & Drop between list boxes Pin
Mycroft Holmes22-Oct-08 23:39
professionalMycroft Holmes22-Oct-08 23:39 
GeneralRe: Problem with Drag & Drop between list boxes Pin
TheComputerMan22-Oct-08 23:44
TheComputerMan22-Oct-08 23:44 
QuestionDesignMode Dilemma! [modified] Pin
Saul Johnson22-Oct-08 8:49
Saul Johnson22-Oct-08 8:49 
AnswerRe: DesignMode Dilemma! Pin
Dave Kreskowiak22-Oct-08 11:43
mveDave Kreskowiak22-Oct-08 11:43 
GeneralRe: DesignMode Dilemma! Pin
Saul Johnson24-Oct-08 4:54
Saul Johnson24-Oct-08 4:54 
QuestionLinkLabels and Data Source Pin
KrisnNala22-Oct-08 8:28
KrisnNala22-Oct-08 8:28 
AnswerRe: LinkLabels and Data Source Pin
Wendelius22-Oct-08 9:40
mentorWendelius22-Oct-08 9:40 
GeneralRe: LinkLabels and Data Source Pin
KrisnNala23-Oct-08 7:08
KrisnNala23-Oct-08 7:08 

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.