|
|
Like Drag Multiple Controls with Shadows Effects[^] ?
Alternatively (but harder) is to draw your controls to a canvas, and use that image as the cursor.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Yes, correct. This is the method I seek.
Thanks a lot!
|
|
|
|
|
You're welcome
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
I have two tables: one as master (Ricetta) the second IngedientiRicetta) as details, in which the details table as a key field that has 'Identity (1,1) ON'.
When I use them on sql 2019 developer server all things run well.
When I use then SQL 2019 Express, I receive the following error:
'When IDENTITY_INSERT is OFF it is not possible to insert an explicit value for the ldentity column in the 'DataTable' IngedientiRicetta,
in System.Data.Common.DbDataAdapter.UpdatedRowStatusErrors(RowUp datedEventArgs rowUpdatedEvent, BatchCommandlnfo0 batchCommands, lnt32 commandCount)
in System.Data.Common.DbDataAdapter.UpdatedRowStatus(RowUpdated EventArgs rowUpdatedEvent, BatchCommandlnfo0 batchCommands, lnt32 commandCount)
in System.Data.Common.DbDataAdapter.Update(DataRowO dataRows, DataTableMapping tableMapping)
in System.Data.Common.DbDataAdapter.UpdateFromDataTable(DataTable dataTable, DataTableMapping tableMapping)
in System.Data.Common.DbDataAdapter.Update(DataTable dataTable) in RicetteVB.RicetteDataSetTableAdapters.lngedientiRicettaTableAdapter.U pdate(lngedientiRicettaDataTable dataTable)
in RicetteVB.Ricette.RicettaBindingNavigatorSaveltem_ Click(Object sender, EventArgs e)"
I will appreciate any help to understand the problem.
Thans
Roberto
|
|
|
|
|
You're trying to insert a value into an identity column. We can't tell you why, or how to fix it, since we can't see your code.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
 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
|
|
|
|
|
hello everybody.
i have drawn up a userform in excel vba adding either a combobox and a checkbox.
after customizing the outline box sizes, in combobobx the arrow drop button has been down sized turning to be very tiny and in check box the blank tick square has been down sized as well becoming very small too. i can t find any property to adjust that size. any tip? thanks
|
|
|
|
|
What I have tried:
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
'Timer1 with intervel 1000ms
Dim OneSecPulse As Boolean
Dim Data As Double
Dim Total As Double
Dim Average As Double
Dim Counts As Integer
OneSecPulse = True
If OneSecPulse = True Then
Counts = Counts + 1
Total = Total + Data
OneSecPulse = False
End If
If Counts = 60 Then
Average = Total / 60
Total = 0
Counts = 0
End If
End Sub
|
|
|
|
|
|
As mentioned in your other post, just total and divide. What's wrong?
My guess is Counts != 60. But all you have to do is debug. Very simple.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
I'm trying to convert some c# code that makes an API function call that has a parameter to a callback. I get a compiler error regarding the "Log" parameter in the call in the frmMain_Load function. How do I define things so that I satisfy the call to this function. Any help is greatly appreciated.
The c# code I'm trying to convert is:
public static IPublicClientApplication PublicClientApp { get; private set; }
static App()
{
PublicClientApp = PublicClientApplicationBuilder.Create(ClientId)
.WithB2CAuthority(AuthoritySignUpSignIn)
.WithLogging(Log, LogLevel.Verbose, false)
.Build();
}
private static void Log(LogLevel level, string message, bool containsPii)
{
string logs = ($"{level} {message}");
StringBuilder sb = new StringBuilder();
sb.Append(logs);
File.AppendAllText(System.Reflection.Assembly.GetExecutingAssembly().Location + ".msalLogs.txt", sb.ToString());
sb.Clear();
}
I've converted the code as follows:
Private Async Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
PublicClientApp = PublicClientApplicationBuilder.Create(ClientId).WithB2CAuthority(AuthoritySignUpSignIn).WithLogging(Log, LogLevel.Verbose, False).Build
End Sub
Function Log(ByVal level As LogLevel, Message As String, ByVal containsPii As Boolean)
Dim logs As String = ($"{level} {Message}")
Dim sb As StringBuilder = New StringBuilder()
sb.Append(logs)
File.AppendAllText(System.Reflection.Assembly.GetExecutingAssembly().Location & ".msalLogs.txt", sb.ToString())
sb.Clear()
End Function
|
|
|
|
|
Try adding AddressOf :
PublicClientApp = PublicClientApplicationBuilder.Create(ClientId).WithB2CAuthority(AuthoritySignUpSignIn).WithLogging(AddressOf Log, LogLevel.Verbose, False).Build()
I don't like either version of the Log function - why does it create a StringBuilder , add one string, and then convert it back to a string? Unless there's other code in there which you haven't shown, you can just use:
private static void Log(LogLevel level, string message, bool containsPii)
{
string logs = $"{level} {message}";
File.AppendAllText(System.Reflection.Assembly.GetExecutingAssembly().Location + ".msalLogs.txt", logs);
}
Private Shared Sub Log(ByVal level As LogLevel, ByVal message As String, ByVal containsPii As Boolean)
Dim logs As String = $"{level} {message}"
File.AppendAllText(System.Reflection.Assembly.GetExecutingAssembly().Location + ".msalLogs.txt", logs)
End Sub
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks Richard. That solved it. Regarding the Stringbuilder, I simply used the online c# to vb.net code converter to get me started. I usually then go back and simplify. I knew the Log routine was insignifcant to problem I was having.
Sorry for posting in the wrong forum. I thought I had picked the VB.net forum. My Mistake. Thanks again.
|
|
|
|
|
I have upgraded my Visual Studio to 2019 but some of the statement can be ran on old version but failed in the new version of 2019 which is using crystal report as following :
Dim DA As New SqlDataAdapter(strsql2, Connection)
Dim DS As New DataSet
Dim strReportName As String
DA.Fill(DS)
Dim rptDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument
rptDocument.Load(strReportPath)
rptDocument.SetDataSource(DS.Tables(0))
WHERE - The rptDocument.SetDataSource(DS.Tables(0)) is not working and always prompted with error of - Failed to load database information.
i spent days and so frustrated about this issue with no idea on how the error occurred, kindly please give me some advise, thx a lots......
Brs
George
|
|
|
|
|
Check the SQL command, and the dataconnectionstring. Try them both in a separate new project, or post those here.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Hi guys, how would i do this pattern in VB?
thanks in advance
modified 11-May-20 14:03pm.
|
|
|
|
|
You have already, in the C# forum, been informed that homework assignments are for you to program. You have a programming assignment, not a "find-someone-who-can-do-the-work-for-me" assignment.
Now is the time for you to show your own coding attempts in both C# and VB, so we can see where you get stuck.
|
|
|
|
|
Hi,
I am developing a playout software using visual basic 2019. Now I need to capture the second screen of my computer and broadcast to youtube/twitch using stream keys or ip output. I've seen mediaplatform sdk, uniplays streamer, and srtstreamer. And i found obs studio at last. but it seems that there is no dll or api or whatever in vb.net. pls help me in this issue
Thanks in advance.
|
|
|
|
|
|
i installed obs separately and working well. but i want to integrate it into my application. Only two functions of OBS are required. Screen capture and stream settings.
|
|
|
|
|
I don't know what sort of response you expect here. You have to figure out how to use this product.
|
|
|
|
|
I would like to know how to fill the Parent table and multi different levels of child tables with data, mean the child tables will be filled with data relate to that Parent table only..
Example:
Level 1 : GRANDFATHER table - Can be fill using Data Adapter Like: (DataAdapter.Fill(DataSet.DataTable,GRANDFATHER-ID) - {(GRANDFATHER-ID is Primary Key)}
here i select specific record and fill and everything good
Level 2 : Father table - Can be fill using Data Adapter Like:(DataAdapter.Fill(DataSet.DataTable, MYGRANDFATHER-ID) - {(MYGRANDFATHER-ID is Foreign Key)}
mean here i can fill level 2 of child table because it is link to one record only from Parent table so I fill all fathers and one Grandfather, and still everything is good
Level 3 : Kids table - Here we face problem!! , How to Fill Data Adapter using multi Fathers ID?? mean i want to fill all kids under multi fathers related to that Parent table of one GRANDFATHER only..
I don not like to fill all Kids Data under all Fathers and All Grandfathers,
hopefully i found solution and clear what I mean...
|
|
|
|
|
Kids don't have multiple fathers; there can be only one.
The table-design is wrong, you don't want a table per generation. More simple, like;
SomeAutoId LONGINT,
ParentId LONGINT,
Name TEXT
The ParentId should point to the parent of the this record. The Id of this record in its own turn will be referenced from any children it has.
E.g.; you have a father (called father for simplicity) and two children (child1 and child2). The data would look like below;
SomeAutoId ParentId Name
1 NULL Father -- Here NULL is used as a parent,
-- because we don
2 1 EngrImad -- Here we point to record 1 in ParentId, as that is your father
3 2 Child1 -- ParentId pointing to the record with your name
23 2 Child2 -- Ditto as above; points to the record with SomeAutoId 2.
24 13 Chris -- not your child :)
1654 23 Grandchild1 -- first child of your second child. This way you can have an entire tree in a database, extend it easy without creating tables on the fly for generations.
That also makes populating the visual tree easier; you query your table for the root-nodes (parents without a ParentId). If that node opens, fetch the children of that node.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
I suggest you dig more in Hierarchical term.
This is an example of visual basic .net winform project that uses MS-Access 2007 database and populate a TreeView control with all Data as [Parent->Child->GrandChild].
VB.NET Access 2007 Hierarchical TreeView[^]
|
|
|
|