|
Hello
please can you tell me how you are adding rows in datagrid because i have problem to add the data into the rows every time rows is inserted on to the top index 0 and data is not displayed
|
|
|
|
|
Using the debugger, step through the code in the SaveData... methods, line-by-line. Check to make sure that your If statement with the HasChanges check returns what you think it does. If HasChanges returns false, then you can get the symptoms you're describing.
When you write code, you can not assume you know that every line is doing. You have to verify that each line is behaving like it should, even if you think you know what it's doing.
If HasChanges works, step through the code in the TableAdapters Update method. It's possible that the code doing the update is wrong somehow.
|
|
|
|
|
Hi Dave
Thnxs for your reply.
I am sertain that HasChanges=True. The statement RowsSaved returns the number of rows that have changed, deleted or inserted.
Maybe a foolish question, but the TableAdapter.Update statement, does it directly execute the update of the database?
In my dataset i have an sql-statement that has generated automatically the needed statements for update, inserting etc ....
Thanks
Hans
|
|
|
|
|
zwaailicht wrote: Maybe a foolish question, but the TableAdapter.Update statement, does it directly execute the update of the database?
Yes, it does.
zwaailicht wrote: In my dataset i have an sql-statement that has generated automatically the needed statements for update, inserting etc
Did it autogenerate the SELECT command, or all of the commands?? Does your database table have a Primary Key?? If not, then you've got a problem where no changes can be made to the database.
|
|
|
|
|
Hi Dave,
All the statements auto autogenerate (select, update, delete, insert).
And Yes each file as an unique key.
Greet
Hans
|
|
|
|
|
Hi guys, how do I install an added merge module in my setup project (vb 2005)? I have 2 merge modules the other one is a windows service, how can i register (installutil service.exe) and start the automatic service soon after installation without the user having to do the manual DOS staff(i mean going to the command prompt and typing ....\installutil ...\service.exe and restarting the machine or having to go to the services list and starting it there)?
thanks in advance
|
|
|
|
|
Override the Commit method of your Installer class and, in that code, use the ServiceController class to start your service.
|
|
|
|
|
Hi all,
I m using datatable.compute method in my application but it not works properly.
In my data table there is feild run (value are 99 and 100).
<br />
Dim datatable As New DataTable<br />
datatable = mydataset.table(0)<br />
<br />
minimum_run = 0<br />
If Not (datatable.Rows.Count = 0) Then<br />
minimum_run = Val(datatable.Compute("MIN(run)", ""))<br />
End If<br />
It gives minimun_run is 100
I don't know what's wrong with my code,Can anyone tell where i m wrong?
Thanks with anticipaton
|
|
|
|
|
Hi,
Please try the following code and if this helps.
Dim datatable As New DataTable
datatable = mydataset.table(0)
Dim minimum_run as Integer = 0
If Not (datatable.Rows.Count = 0) Then
minimum_run = CType(datatable.Compute("MIN(run)", ""), Integer)
End If
I hope this would be helpful.
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
John_Adams wrote: minimum_run = CType(datatable.Compute("MIN(run)", ""), Integer)
That would change the type of the result, but it doesn't change how the values in the data table are compared.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
The first two lines of your code should read:
Dim dataTable As DataTable = mydataset.Tables(0)
What your original code did was create a new instance of a DataTable object, then immediately abandon it and point the datatable variable at an already existing instance of another DataTable object.
|
|
|
|
|
Your data in the table is text, not numbers. The string value "100" is smaller than "99", so the result that you get is correct.
If you want to compare the values numerically, you have to change the data type in the data table.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Thanks to all for having look at my post and reply.
Now i have understood the problem(The data type was string and have to convert in integer)
Thanks once again
|
|
|
|
|
hai
I have created a Main Form in vb.net(windows application) in that main form i have 4 Link buttons like Register,QuoteReq form etc.. when i click the register Link that will go to the Register form..the code wt i used there is
Dim obj as New RegForm
obj.show()
wen i run it is going to the regform but that is opening in a seperate window...For every click a seperate window is opening..i want the new form in the same window only....can any one help....
|
|
|
|
|
you want to open the form in mdi form or you want to open just new form
|
|
|
|
|
In the same window a seperate form has to open..
suppose in my Form1 i have Register, QuoteReq,PaymentForm like that links are there. when i click Register link the page has to be redirected to Register form which is a new one.... I want the new form to be open in the same window ...The design for all the forms are same... only controls are different...
|
|
|
|
|
Then you do what you are already doing, though you have to Hide the form that launched this new form. Something like:
Dim newForm As RegisterForm
Me.Hide()
newForm.Show()
|
|
|
|
|
Why not use a tab control?
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
I'm trying to create a VB User Control that can be used in a WEB page particularly IE7. The control is to be used Client Side and read the Computer & User Name. Can this be done?
I’ve created a VB User Control and tested it in a Windows Form and all is OK but when I embed it into a WEB page it fails. I have strongly signed the app and added it the Assembly Cache using the .NET Framework 2 Configuration tool. Still with no luck. Strangely a simple VB UC that doesn’t try to read Computer or User Name works fine.
I've created many VB6 ActiveX user controls that can be used to read data in this way when embedded in a WEB page but now need a .NET solution.
I'd appreciate any help with this problem.
Regards
Andy Dale
|
|
|
|
|
Andy Dale wrote: I’ve created a VB User Control and tested it in a Windows Form and all is OK but when I embed it into a WEB page it fails. I have strongly signed the app and added it the Assembly Cache using the .NET Framework 2 Configuration tool. Still with no luck. Strangely a simple VB UC that doesn’t try to read Computer or User Name works fine.
But did you add the site to the Trusted Sites list in IE?? I would appear that the control is trying to grab information that is normally off-limits to any code running in a browser window.
Beyond that, I have no idea since I've never done what you're trying. About the best I can do is point you at this[^]. You might be able to gleen something useful from something in that list.
You might also find "How Internet Explorer determines permissions for .NET Framework assemblies"[^] useful too.
|
|
|
|
|
Can any one please tell me how to find the keypress of F2.since functional keys dont have ascii values is there any other way..
|
|
|
|
|
You could use KeyDown event.
in vb6 you can use the const vbKeyF2 (or its value 113 (&H71))
|
|
|
|
|
|
I want to insert the Row at the last row of the data grid but in insert it at the top of the datagridview
i am trying to enter the row like that please help me
dgitem.Rows(i).Cells("Description").Value = frmcontext.lblItem.Text
dgitem.Rows(i).Cells("Quantity").Value = frmcontext.txtQyt.Text
dgitem.Rows(i).Cells("Rate").Value = frmcontext.txtUnitP.Text
dgitem.Rows(i).Cells("GrossTotal").Value = dgitem.Rows(0).Cells("Quantity").Value.ToString * dgitem.Rows(0).Cells("Rate").Value.ToString
dgitem.Rows.Add()
i = i + 1
|
|
|
|
|
Hi,
Please try the following code snippet:
dgitem.Rows(i).Cells("Description").Value = frmcontext.lblItem.Text
dgitem.Rows(i).Cells("Quantity").Value = frmcontext.txtQyt.Text
dgitem.Rows(i).Cells("Rate").Value = frmcontext.txtUnitP.Text
dgitem.Rows(i).Cells("GrossTotal").Value = dgitem.Rows(0).Cells("Quantity").Value.ToString * dgitem.Rows(0).Cells("Rate").Value.ToString
dgitem.Rows.Add(lastrowindex+1)
I hope this helps.
Regards,
John Adams
ComponentOne LLC
|
|
|
|