|
Hi
Is the ID field an AutoNumber?
|
|
|
|
|
I have tried both Autonumber as well as a regular Number and neither work. Currently, it is set for Autonumber
|
|
|
|
|
Hi
Is the SQL statement within the loop?
Chandra
|
|
|
|
|
The following is the entire event handler for btnDelete_Click:
Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDeleteSelected.Click
Dim strSQL As String = ""
Dim nIndex As Integer = 0
Dim nCount As Integer = 0
If lstHistory.SelectedIndex < 0 Then
MsgBox("You must first select the record you wish to delete.", MsgBoxStyle.Critical, "Selection Required")
Else
nIndex = lstHistory.SelectedIndex
lstHistory.ClearSelected()
strSQL = "DELETE FROM tblEvents WHERE ID = " + nIndex.ToString()
Try
oleCommand = New OleDbCommand()
With oleCommand
.Connection = New OleDbConnection(strConn)
.Connection.Open()
.CommandText = strSQL
End With
oleDataAdapter = New OleDb.OleDbDataAdapter(oleCommand)
oleCommand.ExecuteNonQuery()
oleCommand.Connection.Close()
PopulateHistory()
Catch ex As Exception
MsgBox(ex.Message)
End Try
Try
oleCommand = New OleDbCommand()
oleCommand.Connection = New OleDbConnection(strConn)
oleCommand.Connection.Open()
For nCount = 0 To nRecords
oleCommand.CommandText = "UPDATE tblEvents (ID) VALUES (" + nCount + ")"
oleDataAdapter = New OleDbDataAdapter(oleCommand)
Next
oleCommand.Connection.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
End Sub
The UPDATE SQL string is, indeed, within a For loop. I update the ID VALUE of that string with the counter (nCount) of the For loop in attempt to manually update each tuple's ID.
-- modified at 16:32 Tuesday 25th July, 2006
|
|
|
|
|
Hi
I think the SQL statement that you have used for the Update command should read:
"Update tblEvents set Id = " & nCount
Another thing - this is going to try to set the ID of all records in the table, you should specify a "where " clause, that identifies a unique record to be updated.
hth
Chandra
|
|
|
|
|
I'm trying to populate a drop down list from an arraylist.
I have an array called idnums
thought I could do something like this:
Dim C As Integer
Dim I As Integer
C = idnums.Count
For I = 0 To C
dlIdNums.Items.Add(idnums.Item(I))
Next
thanks
|
|
|
|
|
Are you taking about a ComboBox or ASP.NET Control DropDownList
No need for the Loop Just bind the Datasource to the arraylist.
dlIdNums.DataSource = idnums
dlIdNums.DisplayMember = "name" or DataTextField(ASP)
dlIdNums.ValueMember = "value" or DataValueField(ASP)
Check Help if I am wrong it is in there.
|
|
|
|
|
I have a datagrid control, but i dont know how to tell when a user clicks on one of the rows and how to know which row he clicked on!
Can somebody please tell me how to do this.
There are 10 types of people in this world, those who understand binary and those who don't!
|
|
|
|
|
Hi,
How can i acces to allocation table of NTFS disks in .net?
ANd after, i need to write directly to the non-allocated spaces?
Thanx,
Cesur
|
|
|
|
|
have a vb6 program that handle a database file ( access) and i need to save that file to a cd (compact disk) to use it with another program (i.e. to transfer the file from computer to another computer ) and i want to make that by click a "save" command button in my vb6 program
|
|
|
|
|
How can we set column header of datagrid? Suppose there are 3 columns of table in dataset i.e. R,N,A; i want to show r as Roll Number, N as Name of Candidate and A as Age.
Thanks in Advance.
Girish Sharma
|
|
|
|
|
Not sure i understand the question, but perhaps you could make the first row of cells to be labels with the headings of your columns as their text. Maybe make the text bold and background different color to distinguish them from the rest of the datarows?
There are 10 types of people in this world, those who understand binary and those who don't!
|
|
|
|
|
Look at using tablestyles
Mike Lasseter
|
|
|
|
|
The .net datagrid control is total garbage!
Every one wants to sell you a datagrid control that doesn't really do what you want it to!
Can someone please point me to a free datagrid control that has an event that will tell me which row or item a user clicks on.
Please Please Please!
Thanx in advance!
There are 10 types of people in this world, those who understand binary and those who don't!
|
|
|
|
|
how can we implement different file formats in VB.Net
divya
|
|
|
|
|
By writing code that handles different file formats.
I think you are going to have to be a bit more specific if you want a better answer than the flippant response I gave above.
|
|
|
|
|
First explore yourself in MSDN; how many file formats are available in VB.NET. Which 1 u want?
I think self learning and understanding may increase your knowledge-base.
Girish
Girish Sharma
|
|
|
|
|
Girish481 wrote: self learning and understanding may increase your knowledge-base
I know that - but shouldn't you be telling the OP that?
|
|
|
|
|
Actually i want to make an application in VB.Net through which we can upload different file formats just as rtf files and more type of files and after uploading we are able to see that files
divya
|
|
|
|
|
Still too vague. Specify each file type you are interested in.
With RTF you have the option of a RichTextBox (If your application is a windows forms application) in order to show the file. If not then you are going to have to obtain the specification of RTF and provide your own means of translating the file into a viewable format.
|
|
|
|
|
I'm trying to populate a checkbox on a grid. The sub calls the procedure and populates the datagrid without error. However the checkbox does not populate with the correct values and each line shows a "checked" check box
Can you let me know how I can convert the 1 or 0 that the procedure is returning to display a check or blank in the checkbox? An outline of the code is below.
many thanks
Kerrie
Dim t As System.Data.OracleClient.OracleType
Dim r As System.Data.OracleClient.OracleDataReader
Dim aGridTableStyle1 As New DataGridTableStyle
Dim colUser_ID As New DataGridTextBoxColumn
Dim colUSER_DVD_ID As New DataGridTextBoxColumn
Dim colUSER_IFAST_ID As New DataGridTextBoxColumn
Dim colSystem_ID As New DataGridBoolColumn
aGridTableStyle1.MappingName = "T_DVD_VERI"
Me.dtgUSUsers.TableStyles.Clear()
Me.dtgUSUsers.DataBindings.Clear()
With colSystem_ID
.MappingName = "IGNORE_TRADES"
.HeaderText = "System User"
.TrueValue = 1
.FalseValue = 0
.Width = 25
End With
...
aGridTableStyle1.GridColumnStyles.Add(colSystem_ID)
Me.OracleSelectCommand1.CommandText = ....
Me.OracleConnection1.Open()
r = Me.OracleSelectCommand1.ExecuteReader()
dtgUSUsers.TableStyles.Add(aGridTableStyle1)
dtgUSUsers.DataMember = "T_DVD_VERI"
Me.OracleDataAdapter1.Fill(DataSet2, "T_DVD_VERI")
dtgUSUsers.DataSource = DataSet2
dtgUSUsers.Expand(-1)
End Sub
|
|
|
|
|
i have a datagrid in my form... it works fine when i run it from the ide but when i run it using the .exe in the deployment it doesn't work fine... i have a datagrid and it connects to an access database... during the first load after the installation it works... it connects to the database... it shows in the datagrid the data from the database... but when i edit it, the datagrid wouldn't refresh even if i close the application and run it again... but the data in the database is updated... can you please help... tnx...
|
|
|
|
|
if you could explaing your error message and only that part of code which is creating a problem would let us help you.
|
|
|
|
|
Why can't you compile and check it yourself?
Indunil_Bk wrote: this is urgent
I'd like to help but I am too lazy to Google it for you.
|
|
|
|
|
Hi
I have a combobox binded to a table in database.
Table is JobMaster in that there are 2 fields 1)JobCode 2)JobName
In the Combobox I show JobName as Display member and JobCode as Value Member.
When i make a new entry its easy to select the Jobname and JobCode is returned as selectedvalue.
But for editing i have the jobcode from the query, and i have to select the corresponding jobname...how can this be done?
Please Help
Regards
Riyaz Zujer Patanwala
I.T.Programmer
Al Jaber Energy Services
P.O.Box 47467
Abu Dhabi
U.A.E.
|
|
|
|