Private Sub error_out(ByVal line As Integer, ByVal err_col As Integer, ByVal err_msg As String)
Dim ln = t_erori.Rows.Add
[Code]....
I suspect this is because it's trying to add the same row twice.
How can i make this work ? Or what else method could I use to do this ?
I need this datatable because my app is writing some results in there, but any other method to store the results that works with parallel.for would be ok.
I have three sub tables that I want to process. For each I want to combine the rows, as they are only different by contents in the second column(I want to do the same to the fourth column, later):
Dim _tableBackLogs As System.Data.DataTable Do While i - 2 > 0 _tableBackLogs = Global.DataAccess.GetDataTable("SELECT SubjectID,SubjectName,Grade FROM SubjectPI WHERE RegNo='" & CInt(HttpContext.Current.Session("userName")) & "' AND Status='Fail' AND Semester='" & i - 2 & "'") i = i - 2
Doing this replaces the previous data in the DataTable. I want to retain the previous data i.e i want the new rows to be added to the DataTable w/o replacing the previous rows.
I have a service that scans network folders using a parallel.for method. However recently I am finding if I stop the service then while windows says the service is stopped the process is still running in task manager. However it is at 0 cpu and the memory does not change. If I try and end the task (even a force in command prompt) it just says access denied and i have to reboot the server. What would be the best way to make sure everything terminates? I thought of adding a global Boolean that in the stop procedure it turns true and part of my parallel code will check for that and call s.stop.
I have a form with a textbox and a add button. User can write a name down on the textbox and click add button. it will save in a datatable with auto ID. After that, the textbox is cleared and the user can write another name on the text box and click the button. This should add to the existing datatable on memory with existing ID + 1. Show on the gridview. (this is just for display purpose to confirm it works)
I have a datatable like this. Button1.click() event Dim name = txtname.Text Dim dt As New DataTable dt.Columns.Add("ID", GetType(Integer)) [Code] .....
At the moment I have sometime like the code above. in the real program, it is not just name and it is not just one datatable so i just mock up some code. And this code for aspx. <asp:TextBox ID="txtname" runat="server"> </asp:TextBox><asp:Button ID="Button1" runat="server" Text="Button" /> <asp:GridView ID="GridView1" runat="server"> </asp:GridView>
I Have a datatable in .net. I need to flip the location of two of them. For example, a datatable that the select statement had an order by priority clause. The user wants to up the priority of a single row by selecting it and clicking increase priority, how do i move a row up (AKA flip two rows)
The problem is I want merge duplicate serial_no into one row which the value of testong adding to new column. I have tried many ways, but I can't find the solution. Here is my code behind :
I have a datatable object, which is populated from a webservice.Apparently, the web service just throws everything (data) back to me. The data which gets in my datatable looks like this:
I have a Datatable in my code in vb.net. I need to delete rows from the datatable. The name of my Datatable is "temptable".in my row deleting event of a Gridview control. I wrote code as follows:
In the Row_Deleting event of Gridview: temptable.Rows.Remove(Gridview1.Datakeys(e.RowIndex).value)
But,it shows an error as follows: "Cannot cast System.Int32 to System.Data.Datarow".
I have a simple application that uses a database to store usernames and passwords.I have a hidden control that, when activated,should clear all usernames and passwords from the datatable.Then, one admin account is added. I have tried the datatable.clear method BUT while it throws no errors, it doesn't clear the datatable.I have also tried the datatable.reset method, with the same problem. I am now trying this method:
Dim row As DataRow For Each row In Authenticate.Logins row.Delete()[code]....
I have a datatable and I want to create a text file using this datatable. I want that each row of the newly created text file is unique. If there is a duplicate row, then it should add * to both rows ( duplicate rows)
I am using following code:
Dim str As String For Each row As DataRow In dataTable.Rows str += row(1) ' This is text data
I have a DataTable which I want to check if values in three of the columns are unique. If not, the last column should be filled with the line number of the first appearance of the value-combination.
[Code]...
I solved this by iterating the DataTable with two nested for loops and comparing the values. While this works fine for a small amount of data, it gets pretty slow when the DataTable contains a lot of rows.My question is: What is the best/fastest solution for this problem, regarding that the amount of data can vary between let's say 100 and 20000 rows? Is there a way to do this using LINQ? (I'm not too familiar with it, but I want to learn!)
i want to make a datagrid with 2 columns and many rows
the columns i want to have databinding with a datatable i want the 1 row 1 column of datagrid have data from 1 row of datatable i want the 1 row 2 column of datagrid have data from 2 row of datatable
I am new to vb.net and I am trying to query a database and print out the records in the row to the console window. I got it to work, but I have a feeling that there is a more concise way to do this. One thing that I am sure is wrong is that I had to convert the dataset to a datatable to be able to retrieve the values. Is that correct? Could you take a look at the code below (especially the for loop) and let me know what I can improve upon?
Dim datatable_default_view As DataTable = DataTable.DefaultView.ToTable Dim servicenumber As String = datatable_default_view.Rows.Item(e.RowIndex)("Service Number").ToString If datatable.PrimaryKey.Length = 0 Then Dim keys(0) As DataColumn keys(0) = datatable.Columns("Service Number") datatable.PrimaryKey = keys End If Dim datarow_edited As DataRow = datatable.Rows.Find(servicenumber)
I have recently started .NET programming, and looked at both VB.NET and C#. In VB.NET, a strongly typed Datatable cosisted of a collection of strongly types rows. Therefore, for example, this statement would work:
lCustomerTable As CustomerDataSet.CustomerTable lCustomerRow as CustomerDataSet.CustomerTable.CustomerRow lCustomerTable = TableAdapter.GetData lCustomerRow = lCustomerTable.Rows(0)
However in C#, it seems i have to explicitly cast the returned Row to a CustomerRow:
I am using VB.NET 2005. I need to know if I have some data values in a Datatable consisting 4 rows then is it possible to insert all these rows into a Table of a Database using a single INSERT statement?
When my application loops through the first code block below, I get valid data for all datarow fields. [code]...
But I get an error when looping through that code block "Collection was modified; enumeration operation might not execute." [code]...
However, in the second code block, I get a valid record for MgrID, but I get a blank value for the other fields. When I look in the database, all fields in that table have valid values.