Thnk u very much... With Best Regards, Mayur
mayhem_rules
Posts
-
Array issue.....plz help -
Array issue.....plz helpVB.net / sql myrow = DS.Tables("psrec").Rows(0) '1 record - 24 fields Dim myIntArray(24) As Integer For i = 0 To 23 myIntArray(i) = myrow(i) Next Array.Sort(myIntArray) maxunits = myIntArray(24) wat leaves me stumped is that since the array starts from 0, it should end at 23. However, the maxvalue can be found at myIntArray(24). when i print the array using the code, For i = 0 To 23 Console.WriteLine(myIntArray(i)) Next I always get 0 for myIntArray(0) for every record and the actual values are displayed from myIntArray(1). Therefore, one value is missed since the array prints till myIntArray(23). The last value is at myIntArray(24). Can you explain this to me... With Best Regards, Mayur
-
Find maximum value from a recordThnx Kschuler. the 1st query will give us the max value for each field. Also, the 2nd query, I am not sure if it works, may give us just one value. wat i neede is the max value of all the fields for each record. right now i am getting each field (every record) in an array, sorting it and getting the highest value from it. see the code below. myrow = DS.Tables("psrec").Rows(0) '1 record - 24 fields Dim myIntArray(24) As Integer For i = 0 To 23 myIntArray(i) = myrow(i) Next Array.Sort(myIntArray) maxunits = myIntArray(24) wat leaves me stumped is that since the array starts from 0, it should end at 23. However, the maxvalue can be found at myIntArray(24). when i print the array using the code, For i = 0 To 23 Console.WriteLine(myIntArray(i)) Next I always get 0 for myIntArray(0) for every record and the actual values are displayed from myIntArray(1). Therefore, one value is missed since the array prints till myIntArray(23). The last value is at myIntArray(24). Can you explain this to me... With Best Regards, Mayur
-
Find maximum value from a recordVB.net / sql Consider a table having A - Z fields storing integer values. Therefore each record in this table will have A - Z fields. I need to find the maximum value for each record from the fields A - Z. Can you plz help me with this. With Best Regards, Mayur
-
Finding maximum value from a series...Thanks Guffa. I understand what you mean to say. Can you suggest a way this can be done using vb.net. As in reading a record and then finding the maximum value through code... With Best Regards, Mayur
-
Finding maximum value from a series...Thnx Robert. Maybe I will try and explain it once again. Consider a table having A - Z fields storing integer values. Therefore each record in this table will have A - Z fields. I need to find the maximum value for each record from the fields A - Z. Can you plz help me with this. With Best Regards, Mayur
-
Finding maximum value from a series...thnx for your reply. However, I do not want to find the max value from a particular field. I need to find the maximum of the value from the fields A to F. say A has a value 1, B-2, C-3, D-4, E-5, F-3, then I need to find the value 5 using a query or a piece of code. Remember A, B, C, D, E & F are field names and not records. With Best Regards, Mayur
-
Finding maximum value from a series...VB.net / sql. Consider I have a table in sql with fields A to F each storing an integer value. I need to find the maximum value from the fields. Can anyone help me with this. Can this be done through a sql query? if yes, then how and if not then how to find the maximum value through program. plz help fast... With Best Regards, Mayur
-
Export datagrid to excelI need to export the contents of a datagrid to csv. Can anyone guide me as to how this is done. With Best Regards, Mayur
-
Using TreeView In VB.NetCan anyone provide some good examples or links for using TreeView in VB.Net. With Best Regards, Mayur
-
Comparing strings with variable lengths/misspells/...VB.NET/MS ACCESS/SQL Consider the following data: No Name Salary 1 Shawn DSouza I 4000 2 sHAWN D'Souza I 3000 3 Shaw-n DSouza I 2000 The above data is almost similar other that the cases or typing errors or maybe different ways of writing similar things. The data I have contain several such records. What I need to do is group such records together and filter out one record with the highest salary. It seems like we need to apply some intelligent search ! Can someone help me with this. With Best Regards, Mayur
-
Issue with Export To ExcelEven if I convert the cell to TEXT, the result is the same. With Best Regards, Mayur
-
Issue with Export To ExcelHi Guys, I am working on VB.NET/Access. Consider the data 0000011. I am writing the data in CSV format to a file. When I open the file with notepad, the data looks correct. However, when I open in excel, the leading zeros are truncated. It appears as a number. how do you write such data to open correctly in excel. With Best Regards, Mayur
-
How to update a TableAdapterFirst create a command builder and then update the Data Adapter. Dim CB As New OLEDBCommandBuilder(myTableTableAdapter) Me.myTableTableAdapter.Update(Me.DBDataSet.myTable) With Best Regards, Mayur
-
VB.NET / MS Access Threading Issue...I am running a procedure in a thread which is created on the click of a button. However, the process does not complete correctly. Please refer to the code below: Private Sub cmdProcess_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdProcess.Click Try Dim tquery As Thread tquery = New Thread(AddressOf Me.GetData) tquery.Start() Catch ex As Exception MessageBox.Show(ex.Message, "Error In cmdProcess_Click", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try End Sub Private Sub GetData() Try Dim field1, field2, op1, period1, value1 As String Dim m1, y1, tablename As String period1 = Trim(cmbPeriod.Text) m1 = Mid(Trim(period1), 5, 2) y1 = Mid(Trim(period1), 3, 2) tablename = "SSA" & m1 & y1 field1 = Trim(cmbField1.Text) value1 = Trim(cmbValue.Text) op1 = Trim(cmbOP1.Text) field2 = Trim(cmbField2.Text) str = "select " & Trim(op1) & "(" & Trim(field2) & ") from " & Trim(tablename) & " group by " & Trim(field1) & " order by " & Trim(field1) ipcon.Open() DA = New OleDbDataAdapter(str, ipcon) DS = New DataSet DA.Fill(DS, "qrec") ipcon.Close() DataGrid1.SetDataBinding(DS, "qrec") Catch ex As Exception MessageBox.Show(ex.Message, "Error In GetData", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try End Sub -- This code exits with the following error message 'Controls created on one thread cannot be parented to a control on a different thread' Please guide me how to resolve this issue. With Best Regards, Mayur
-
'Out Of Memory Exception' during Data AccessHi, I am trying to get the entire data into the dataset and then let the user query this dataset as per his needs. What is happening currently is that every query is being run directly on the database. I want to avoid this. With Best Regards, Mayur
-
Export DataGridView to Excel (xls) formatI am having the same problem. Please provide me the solution if you happen to get one. With Best Regards, Mayur
-
'Out Of Memory Exception' during Data AccessThnx Deepak. I am using Vb.NEGT with MS Access. Do you mean to say that I need to use OledbDataReader to retrieve the data? With Best Regards, Mayur
-
'Out Of Memory Exception' during Data AccessHi, I am querying a DB and I want to get the data (Around 1 crore records) in a dataset. then I want to perform other operations on the data in the dataset. However, the process does not complete correctly. The program displays an 'Out Of Memory Exception' and the process is terminated. Can anyone suggest how this issue can be overcome. Thnx for any help. With Best Regards, Mayur
-
Need Help With Threading Issue...Hi, I am new to .Net and working with threads for the first time. Please review the code below. Dim t As Thread t = New Thread(AddressOf Me.GetValue) ' GetValue is a procedure t.Start() In GetValue, I want to get some data from the DB and fill in a combobox. However, when the following code in GetValue executes - str = "select ID from ABC" DA = New OleDbDataAdapter(str, ipcon) DS = New DataSet DA.Fill(DS, "rec") - the control is lost. i.e: the next set of statements (to fill the combobox with the dataset values) do not execute. I am not sure why such a thing is happening. Is there some way to handle this threading issue that I am missing? Please help. With Best Regards, Mayur