Click here to Skip to main content
15,885,767 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionMove an user control by drag & drop Pin
Fabrizio Pulvirenti7-Jun-20 8:54
Fabrizio Pulvirenti7-Jun-20 8:54 
AnswerRe: Move an user control by drag & drop Pin
Richard MacCutchan7-Jun-20 21:56
mveRichard MacCutchan7-Jun-20 21:56 
AnswerRe: Move an user control by drag & drop Pin
Eddy Vluggen8-Jun-20 1:21
professionalEddy Vluggen8-Jun-20 1:21 
GeneralRe: Move an user control by drag & drop Pin
Fabrizio Pulvirenti8-Jun-20 5:20
Fabrizio Pulvirenti8-Jun-20 5:20 
GeneralRe: Move an user control by drag & drop Pin
Eddy Vluggen8-Jun-20 6:34
professionalEddy Vluggen8-Jun-20 6:34 
QuestionSQL error on bound datagridviews (master detail) Pin
roa20111-Jun-20 6:18
roa20111-Jun-20 6:18 
AnswerRe: SQL error on bound datagridviews (master detail) Pin
Richard Deeming1-Jun-20 7:48
mveRichard Deeming1-Jun-20 7:48 
GeneralRe: SQL error on bound datagridviews (master detail) Pin
roa20112-Jun-20 0:53
roa20112-Jun-20 0:53 
Iam sending the code tha is - for me - involved

Private Sub Ricette_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        Try
            DS = New RicetteDataSet
            Me.IngedientiRicettaDataGridView.Visible = True
            If RiceID = 0 Then
                TaRicette.Fill(DS.Ricetta)
            Else
                TaRicette.FillBy1(DS.Ricetta, RiceID)
                RiceID = 0
            End If

            TaIngredienti.Fill(DS.Ingedienti)
            TaIngredientiRicetta.Fill(DS.IngedientiRicetta)
            TaUm.Fill(DS.Um)
            TaTipoCottura.Fill(DS.TipoCottura)
            TaCategoria.Fill(DS.Categorie)

            '------------------------------------------------------------------------
            IngredientiBindingSource.DataMember = "Ingedienti"
            IngredientiBindingSource.DataSource = DS

            TipoCotturaBindingSource.DataSource = DS
            TipoCotturaBindingSource.DataMember = "TipoCottura"

            CategorieBindingSource.DataMember = "Categorie"
            CategorieBindingSource.DataSource = DS

            UmBindingSource.DataSource = DS
            UmBindingSource.DataMember = "Um"
            '------------------------------------------------------------------------
            Me.RicettaBindingSource.DataSource = DS
            Me.RicettaBindingSource.DataMember = "Ricetta"
            Me.RicettaBindingSource.Position = pos
            'Me.RicettaBindingSource.MoveLast()

            IngredientiRicettaBindingSource.DataSource = RicettaBindingSource
            IngredientiRicettaBindingSource.DataMember = "FK_IngedientiRicetta_Ricetta"
            '------------------------------------------------------------------------


        Catch nhex As InvalidOperationException
            MsgBox(nhex.Message)
        Catch ex As Exception
            Err(ex, "Form Load" & Me.Name)
        End Try
    End Sub
	'----- Saving IngedientiRicettaDatagridView to IngedientiRicetta SQL Table-----
	
	Private Sub BtnSalvaIngredienti_Click(sender As Object, e As EventArgs) Handles BtnSalvaIngredienti.Click
        Try
            Validate()
            RicettaBindingSource.EndEdit()
            CategorieBindingSource.EndEdit()
            UmBindingSource.EndEdit()
            TipoCotturaBindingSource.EndEdit()
            IngredientiBindingSource.EndEdit()

            IngredientiRicettaBindingSource.EndEdit()
            TableAdapterManager.UpdateAll(DS)
            'TaIngredientiRicetta.Update(DS.IngedientiRicetta)

        Catch nhex As InvalidOperationException
            MsgBox(nhex.Message)

        Catch ex As Exception
            Err(ex, Name)
        End Try

    End Sub
	
'-----------------------------------------------------
'Adding new row to IngedientiRicettaDataGridView
'-----------------------------------------------------
    Private Sub IngedientiRicettaDataGridView_DefaultValuesNeeded(sender As Object, e As DataGridViewRowEventArgs) Handles IngedientiRicettaDataGridView.DefaultValuesNeeded
        Try
            With e.Row
                .Cells("IngredienteRicettaQtaDataGridViewTextBoxColumn").Value = 0
                .Cells("IngredienteNome").Value = String.Empty
                .Cells("IngredienteRicettaNoteDataGridViewTextBoxColumn").Value = String.Empty
            End With

        Catch ex As Exception
            Err(ex, Name)
        End Try

    End Sub


thing that is strange for me:
in the dataset the constraint between 'Ricetta' and 'IngedientiRicetta' is:

INSERT or UPDATE= None
DELETE=None

While in SQL we have

INSERT or UPDATE=Cascade
DELETE = Cascade

In any case I don't give a value to IngedientiRicettaID (key and identity)

Also in datagridview is not added as column.


But why all is good in one SQL server (developer) and wrong in another server (SQL EXPRESS)?


NOTE:The bound IngedientiDataGridView with columns has been created at Design Time


Thanks
Questionexcel vba combobox and checkbox elements resizing Pin
Mat 25728-May-20 3:14
Mat 25728-May-20 3:14 
Questioni want to take average of it of one min. i have tried this code but no result found. please help Pin
Tommy Jo21-May-20 5:23
Tommy Jo21-May-20 5:23 
AnswerRe: i want to take average of it of one min. i have tried this code but no result found. please help Pin
Richard MacCutchan21-May-20 5:42
mveRichard MacCutchan21-May-20 5:42 
AnswerRe: i want to take average of it of one min. i have tried this code but no result found. please help Pin
ZurdoDev21-May-20 6:03
professionalZurdoDev21-May-20 6:03 
QuestionHow to call a function as a callback parameter Pin
chug100818-May-20 8:58
chug100818-May-20 8:58 
AnswerRe: How to call a function as a callback parameter Pin
Richard Deeming18-May-20 23:56
mveRichard Deeming18-May-20 23:56 
GeneralRe: How to call a function as a callback parameter Pin
chug100820-May-20 9:29
chug100820-May-20 9:29 
QuestionCrystal Report SetDataSource Issue Pin
GeorgeChu15-May-20 6:03
GeorgeChu15-May-20 6:03 
AnswerRe: Crystal Report SetDataSource Issue Pin
Eddy Vluggen15-May-20 7:38
professionalEddy Vluggen15-May-20 7:38 
QuestionMake a simple pattern/shape Pin
M.S.S.E10-May-20 19:21
M.S.S.E10-May-20 19:21 
AnswerRe: Make a simple pattern/shape Pin
kalberts10-May-20 20:59
kalberts10-May-20 20:59 
Questiondesktop/screen streaming to youtube/twitch by stream key or IP in visual basic.net Pin
sharath Nandakumar9-May-20 0:21
sharath Nandakumar9-May-20 0:21 
AnswerRe: desktop/screen streaming to youtube/twitch by stream key or IP in visual basic.net Pin
Richard MacCutchan9-May-20 1:22
mveRichard MacCutchan9-May-20 1:22 
GeneralRe: desktop/screen streaming to youtube/twitch by stream key or IP in visual basic.net Pin
sharath Nandakumar9-May-20 7:11
sharath Nandakumar9-May-20 7:11 
GeneralRe: desktop/screen streaming to youtube/twitch by stream key or IP in visual basic.net Pin
Richard MacCutchan9-May-20 21:23
mveRichard MacCutchan9-May-20 21:23 
QuestionFill Data of Parents and multi levels of Child tables only Pin
EngrImad2-May-20 13:53
EngrImad2-May-20 13:53 
AnswerRe: Fill Data of Parents and multi levels of Child tables only Pin
Eddy Vluggen2-May-20 21:41
professionalEddy Vluggen2-May-20 21:41 

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.