
skyyakal
Avatar/Signature-
Posts
77 -
Joined
-
Last visited
Personal Information
-
Visual Studio .NET Version
2002
-
.NET Preferred Language
VB.NET
skyyakal's Achievements
Newbie (1/14)
0
Reputation
-
Transferring Data to Ms SQL Server
skyyakal replied to skyyakal's topic in Database / XML / Reporting
I found my error. I had to put AccepedChanges at the end :-) like that: Dim Counter As Integer Dim MyTable As DataTable = Me.Sim_DataSet.Tables("SimVariablesValues") For Counter = Convert.ToInt32(VVfrom_txtbox.Text) To Convert.ToInt32(VVto_txtbox.Text) Step Convert.ToInt32(VVStep_txtbox.Text) Dim NewEntry As DataRow = MyTable.NewRow NewEntry(0) = Me.FormID NewEntry(1) = Counter NewEntry(2) = Counter MyTable.Rows.Add(NewEntry) Console.WriteLine("Counter:" & Counter) Next Sim_SqlDataAdapter.Update(Sim_DataSet.SimVariablesValues) Me.Sim_DataSet.AcceptChanges() -
Hello everybody, I'm killing myself with the following problem. I have a DataGrid and two buttons below. The first button1 executes the following code: Dim Counter As Integer Dim MyTable As DataTable = Me.Sim_DataSet.Tables("SimVariablesValues") For Counter = Convert.ToInt32(VVfrom_txtbox.Text) To Convert.ToInt32(VVto_txtbox.Text) Step Convert.ToInt32(VVStep_txtbox.Text) Dim NewEntry As DataRow = MyTable.NewRow NewEntry(0) = Me.FormID NewEntry(1) = Counter NewEntry(2) = Counter MyTable.Rows.Add(NewEntry) Console.WriteLine("Counter:" & Counter) Next Me.Sim_DataSet.AcceptChanges() Sim_SqlDataAdapter.Update(Sim_DataSet.SimVariablesValues) the second button2 executes this one: Sim_SqlDataAdapter.Update(Sim_DataSet.SimVariablesValues) If I add values in the DataSheet per hand and press the button2 all values from DataGrid is transferred to Ms SQL Server. If I press the button1, DataGrid shows the new values, but the data is not transferred to Ms SQL Server. Do I do anything wrong with Sim_SqlDataAdapter.Update(Sim_DataSet.SimVariablesValues) ?!?!??!?! I would appreciate any help! Greetings, cygent
-
How to confirm the "YES" Button automatically?
skyyakal replied to skyyakal's topic in Windows Forms
I already tried it. Support said, that they implement the supression of this interface in the later version than my :-( As it looks like I have to fiddle around... Thanks for the reply... Non-american American :-) -
Hallo everybody! I have a software, which has a VBA interface. Through this interface I can control the software. My problem is that at the beginning of the run the software opens an interface and asks, if I would like to save my file. Is there any VB command that gives this interface an "YES" ? Thank for your comments! Ciao! cygent
-
Some guys asked me to post the results, if I would solve the problem. Sine the previous post was closed by administrator because of a fight with an American, I posted the problem and the answer once more. Here is the code for my N to M Array permutation. Sorry for no comments in the code, I was in the harry. If someone has got questions just write. CardValueArray is defined somewhere esle and is a structure array, wich contains arrays of different length with values I would like a permutation on. Any comments are appreciated!!! Public Sub Permutation() Dim Counter, InnerCounter, LeftBound, SetBackLoop, ControlSum, ArrayUpperBound, GreenLight, Move, Zeroing, CheckNextNonMaxPos, LeftBoundZeroing As Integer Dim PermutationVar As String Dim CounterPosition(), MaxPosition() As Integer ArrayUpperBound = CardValueArray.GetUpperBound(0) - 1 ReDim CounterPosition(ArrayUpperBound) ReDim MaxPosition(ArrayUpperBound) 'Setting the boundaries for the Counters and the initial Counter values For Counter = 0 To ArrayUpperBound MaxPosition(Counter) = CardValueArray(Counter + 1).Value.GetUpperBound(0) - 1 CounterPosition(Counter) = 0 Next GreenLight = 1 LeftBound = 0 Do While (GreenLight = 1) Move = 1 'Writing a Permutation For Counter = 0 To ArrayUpperBound PermutationVar = PermutationVar & Convert.ToString(CardValueArray(Counter + 1).Value(CounterPosition(Counter))) & ";" Next Console.WriteLine(PermutationVar) PermutationVar = "" 'Moving the Counters If (CounterPosition(0) = MaxPosition(0)) Then LeftBoundZeroing = 1 For Counter = 0 To ArrayUpperBound ControlSum = MaxPosition(Counter) - CounterPosition(Counter) If (ControlSum <> 0 And LeftBoundZeroing = 1) Then LeftBound = Counter LeftBoundZeroing = 0 Else ControlSum = 0 For InnerCounter = 0 To ArrayUpperBound ControlSum = ControlSum + (MaxPosition(InnerCounter) - CounterPosition(InnerCounter)) Next If (ControlSum = 0) Then Exit Do End If End If Next End If Zeroing = 1 For Counter = ArrayUpperBound To LeftBound Step -1 If (CounterPosition(Counter) = MaxPosition(Counter) And Zeroing = 1) Then ControlSum = 0 For InnerCounter = Counter To ArrayUpperBound ControlSum = ControlSum + (MaxPosition(InnerCounter) - CounterPosition(InnerCounter)) Next If (ControlSum = 0) Then For InnerCounter = ArrayUpperBound To LeftBound Step -1 CheckNextNonMaxPos = MaxPosition(InnerCounter) - CounterPosition(InnerCounter) If (CheckNextNonMaxPos <> 0 And Zeroing = 1) Then CounterPosition(InnerCounter) = CounterPosition(InnerCounter) + 1 For SetBackLoop = (InnerCounter + 1) To ArrayUpperBound CounterPosition(SetBackLoop) = 0 Next Move = 0 Zeroing = 0 End If Next End If End If Next If (Move = 1) Then CounterPosition(ArrayUpperBound) = CounterPosition(ArrayUpperBound) + 1 End If Loop End Sub
-
I have arrays with the following characteritics: The number of arrays is varying depending on the values, that an users enters on a form. The length of each array is also different each time they are created. I need a recombination of all values saved in these arrays, which would mean.... Example: If there are 3 Arrays with the length of 4 Values, 3 Values and 1 Value, I need to generate the following code: FOR array1=1 To 4 FOR array2=1 To 3 FOR array3=1 To 1 ... NEXT NEXT NEXT As a result I need the following. If Array1 has values: 1, 11, 111, 1111 Array2 has values: 2, 22, 222 Array3 has values: 3 At the end I need all the values above recombined in single lines in a text file like that: [code] 3; 2; 1 3; 22; 1 3; 222; 1 3;2;11 3;22;11 3;222;11 3; 2; 111 3; 22; 111 3; 222; 111 3;2;1111 3;22;1111 3;222;1111 there any METHOD that builds/writes VB code? I thought of the following solution: Generating the VB code as Text and write it to a file. Then include this file at the appropriate place in my programm. But here I cannot find the include method. Would anyone know, what is a syntax for an "INCLUDE"-Method? Second solution: Any idea about the recursion? Thank you everybody in advance!!!
-
Is there a possibility to call a function without giving the number of arguments? for example DIM func(LaLaLaLa) As Integer and then call for example one time func(4, 7, 3, 8) and the second time func(1, 3)? Would appreciate the answer.
-
Still cannot find the solution. Can anyone tell me, is there absolutely no possibility to import VB Code from a text file through an "include" method? If there is such one you can build much better code to solve my problem. Thank you for your comments!
-
Full Link: http://www.csse.monash.edu.au/~lloyd/ tildeAlgDS/Recn/Perm/
-
Hallo PlausiblyDump! working on http://www.csse.monash.edu.au/~lloyd/tildeAlgDS/Recn/Perm/ It gives solution for permutation on ...4567... sequences. My values are absolutely random. But instead I could use the indexes of my arrays, they are such ...4567... sequences. Working on the VB Code...
-
One more question. Is there a method in VB, which would import VB. Code from external source like a text file?! This would ease the whole programming tremendously! Can I contact Robby somehow?! Or I can only hope, he will have a look at this part of the forum. He ment, you can do such permutations in a logic way...
-
Hallo PlausiblyDump! Thank you so much for your replies. I will check the links! Will write as soon as I get this working. I need this for a software, that generates scenarios. Therefore the recombination algorithm. Each line represents a scenario. Thanks again for your help!
-
Hallo PlausiblyDamp, now you are going the wrong direction. I don't need all values of a card in a line. I need all possible recombination of card values in one line Here is an axample. Card1 has values: 1, 11, 111, 1111 Card2 has values: 2, 22, 222 Card3 has values: 3 At the end I need all the values above recombined in single lines of a text file like that: 3; 2; 1 3; 22; 1 3; 222; 1 3;2;11 3;22;11 3;222;11 3; 2; 111 3; 22; 111 3; 222; 111 3;2;1111 3;22;1111 3;222;1111 Now imagine, the number of Cards is different each time a program starts. The number of values of each card is different as well (among each other also). How do I do the recombination dynamically?! To solve this I need the code construction showed in my post 11-02-2003 10:26 PM. Thank you again for your help!!!
-
in your post 11-02-2003 09:42 PM YOU ARE COMPLITELY RIGHT PlausiblyDump!!!! :-) Thank you very much!!! Please give me further suggestions, so I could look for a solution parallely!