Click here to Skip to main content
15,895,011 members
Home / Discussions / Database
   

Database

 
GeneralRe: Using DATEFIRST in a View - I want the week to start on Monday instead of Sunday. Pin
tojamismis13-Dec-04 6:48
tojamismis13-Dec-04 6:48 
GeneralLines of Invoice Pin
ruifernandes2412-Dec-04 11:13
ruifernandes2412-Dec-04 11:13 
GeneralRe: Lines of Invoice Pin
Edbert P12-Dec-04 13:12
Edbert P12-Dec-04 13:12 
Generalinsert string wiht ' chare Pin
Anonymous12-Dec-04 5:43
Anonymous12-Dec-04 5:43 
GeneralRe: insert string wiht ' chare Pin
DavidNohejl12-Dec-04 7:16
DavidNohejl12-Dec-04 7:16 
GeneralRe: insert string wiht ' chare Pin
Edbert P12-Dec-04 13:14
Edbert P12-Dec-04 13:14 
General.Net/COM+ Pin
Member 131282211-Dec-04 22:31
Member 131282211-Dec-04 22:31 
GeneralUpdating SQL Server 2000 with varying column names Pin
ColdWaterBlue11-Dec-04 16:03
ColdWaterBlue11-Dec-04 16:03 
I am trying to update a table in SQL Server 2000 that will be able to have varying column names (based on the user's specifications). I can read the data fine, but I can't add anything to the table. There are spaces in the column name (i.e. "Received By") and when reading I put brackets [] around it and it works. When I am trying to write to the table, I can update the dataset fine, but not the table in SQL Server. I believe it is a problem with my parameter declaration. When I try to save the data, I get the following error:

Line 1: Incorrect syntax near 'varchar'.

My code is as follows (not everything because it is quite lengthy):

Dim custom01 As String 'Contains the name of the column/field
Dim sampleTable As String 'Contains the name of the table within SQL Server

sampleUpdate = New SqlClient.SqlCommand("UPDATE " & sampleTable & " SET " & custom01 & " = @" & custom01, dataConnect)
With sampleUpdate
With .Parameters
.Add("@" & custom01, SqlDbType.Varchar, 50, custom01)
End With
End With

As I said, I can update the dataset fine, but when I try to up the dataset back into SQL Server, it crashes. Any thoughts would be greatly appreciated.

GeneralRe: Updating SQL Server 2000 with varying column names Pin
Mekong River11-Dec-04 16:53
Mekong River11-Dec-04 16:53 
GeneralRe: Updating SQL Server 2000 with varying column names Pin
ColdWaterBlue11-Dec-04 21:13
ColdWaterBlue11-Dec-04 21:13 
GeneralFinding lowest integer in an Access Database Pin
pjholliday11-Dec-04 11:24
pjholliday11-Dec-04 11:24 
GeneralRe: Finding lowest integer in an Access Database Pin
Mekong River11-Dec-04 16:59
Mekong River11-Dec-04 16:59 
GeneralRe: Finding lowest integer in an Access Database Pin
pjholliday12-Dec-04 2:24
pjholliday12-Dec-04 2:24 
GeneralRe: Finding lowest integer in an Access Database Pin
Edbert P12-Dec-04 13:24
Edbert P12-Dec-04 13:24 
GeneralUrgent ! Doubt in Sql Pin
goldsuji11-Dec-04 0:54
goldsuji11-Dec-04 0:54 
GeneralRe: Urgent ! Doubt in Sql Pin
venadder11-Dec-04 8:42
venadder11-Dec-04 8:42 
GeneralRe: Urgent ! Doubt in Sql Pin
goldsuji12-Dec-04 19:48
goldsuji12-Dec-04 19:48 
GeneralRe: Urgent ! Doubt in Sql Pin
Mekong River11-Dec-04 17:04
Mekong River11-Dec-04 17:04 
Generalbackup fails!!Urgent Pin
venadder10-Dec-04 13:03
venadder10-Dec-04 13:03 
GeneralRe: backup fails!!Urgent Pin
venadder11-Dec-04 7:04
venadder11-Dec-04 7:04 
GeneralUsing Instances of CRecordset Pin
Chris Meech10-Dec-04 8:20
Chris Meech10-Dec-04 8:20 
GeneralSpecified cast is not valid Pin
Anonymous10-Dec-04 7:44
Anonymous10-Dec-04 7:44 
GeneralRe: Specified cast is not valid Pin
tojamismis10-Dec-04 12:36
tojamismis10-Dec-04 12:36 
GeneralCannot connect to SQL Server using Visual Studio .NET and Query Analyzer Pin
jomargon10-Dec-04 5:25
jomargon10-Dec-04 5:25 
GeneralRe: Cannot connect to SQL Server using Visual Studio .NET and Query Analyzer Pin
Colin Angus Mackay10-Dec-04 5:44
Colin Angus Mackay10-Dec-04 5:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.