A
Adam Sandler
Hello,
Using VWD 2005 here... I have a question about writing SQL in a
TableAdapter. Our DB server here is Oracle but since I'm just
prototyping right now, I created a copy of the table I need in Access
and I'm connecting to Access on my local machine.
I right-clicked my TableAdapter and selected Add Query... | the Use SQL
Statements radio button | Delete. This was the default statement which
appeared in the Query Configuration Wizard "DELETE FROM [T_PERSONNEL]
WHERE (([N_EVENTID] = ?))"
The table has a name column. I don't expose N_EVENTID on the webpage.
So I clicked the Query Builder button because I want to change the
column in the where clause from N_EVENTID to S_NAME. I give the query
the name of "myDeleteQuery" and click finish.
In the code behind, this is the code attached to a button...
Dim ta As New DataSet1TableAdapters.T_PERSONNELTableAdapter
ta.myDeleteQuery(Me.Edit1.Text)
Here's where the problem arises... I get Invalid precision errors when
the above code is executed. Some simple debugging shows what is going
on. What is getting sent to the DB is myDeleteQuery(S_NAME As String)
As Integer.
1. Is there a way to keep the IDE from casting the SQL to another type
when using the query builder?
2. Is it becuase I changed the column from N_EVENTID to S_NAME in the
SQL wizard?
3. The XML for the table adapter shows has DbType="String", so again,
I'm confused as to why VWD puts the As Integer on the end of my method.
In Access, can one only delete a row by the primary key?
Thanks!
Using VWD 2005 here... I have a question about writing SQL in a
TableAdapter. Our DB server here is Oracle but since I'm just
prototyping right now, I created a copy of the table I need in Access
and I'm connecting to Access on my local machine.
I right-clicked my TableAdapter and selected Add Query... | the Use SQL
Statements radio button | Delete. This was the default statement which
appeared in the Query Configuration Wizard "DELETE FROM [T_PERSONNEL]
WHERE (([N_EVENTID] = ?))"
The table has a name column. I don't expose N_EVENTID on the webpage.
So I clicked the Query Builder button because I want to change the
column in the where clause from N_EVENTID to S_NAME. I give the query
the name of "myDeleteQuery" and click finish.
In the code behind, this is the code attached to a button...
Dim ta As New DataSet1TableAdapters.T_PERSONNELTableAdapter
ta.myDeleteQuery(Me.Edit1.Text)
Here's where the problem arises... I get Invalid precision errors when
the above code is executed. Some simple debugging shows what is going
on. What is getting sent to the DB is myDeleteQuery(S_NAME As String)
As Integer.
1. Is there a way to keep the IDE from casting the SQL to another type
when using the query builder?
2. Is it becuase I changed the column from N_EVENTID to S_NAME in the
SQL wizard?
3. The XML for the table adapter shows has DbType="String", so again,
I'm confused as to why VWD puts the As Integer on the end of my method.
In Access, can one only delete a row by the primary key?
Thanks!