Click here to Skip to main content
15,914,419 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: HOW CAN I ACCESS THE BUTTON CONTROL FROM ASPX IN ASPX.CS? Pin
Albert8330-Dec-07 18:45
Albert8330-Dec-07 18:45 
QuestionHow to use SSRS ? Pin
mehrdadc4830-Dec-07 6:00
mehrdadc4830-Dec-07 6:00 
AnswerRe: How to use SSRS ? Pin
Michael Sync30-Dec-07 6:40
Michael Sync30-Dec-07 6:40 
GeneralReading files from server and displaying links Pin
CodeBase2530-Dec-07 5:08
CodeBase2530-Dec-07 5:08 
GeneralRe: New Project, please advise!! Pin
Michael Sync30-Dec-07 6:35
Michael Sync30-Dec-07 6:35 
GeneralRe: New Project, please advise!! Pin
CodeBase2530-Dec-07 12:21
CodeBase2530-Dec-07 12:21 
QuestionObjectDatasource Edit/Delete problem Pin
arefkarimi29-Dec-07 23:47
arefkarimi29-Dec-07 23:47 
QuestionProblem updating database Pin
David Kalkwarf29-Dec-07 12:11
David Kalkwarf29-Dec-07 12:11 
I am having a problem updating a table field in my database. Note that I am using Visual Web Developer 2008 Express.

I am using the asp_XYZ tables for membership, etc. My table (MyTable) contains a UserId field, which comes from the aspnet_Users table. The field I wish to update is MyField and is of type 'image'

I would like to populate my WebForm/FormView with MyField and allow the user to edit/update it. I do not have a problem populating the view, but cannot figure out the UpdateCommand. BTW, my SELECT command is something like this:

SELECT MyTable.MyField
FROM MyTable
INNER JOIN aspnet_Users ON MyTable.UserId = aspnet_Users.UserId
WHERE aspnet_Users.UserName = @UserName

I cannot figure out how to update. When I use the Configure Data Source wizard, it only allows me to choose fields from one table. I thought that I would be able to specify MyTable.MyField as a field to update and aspnet_Users.UserName as a field to filter. Confusion is setting in...

Since I thought I basically knew what my eventual UPDATE command was going to be, I went ahead and typed it myself. The following is that command and its UpdateParameters.

UPDATE MyTable
SET MyField = @MyField
FROM MyTable INNER JOIN aspnet_Users ON MyTable.UserId = aspnet_Users.UserId WHERE (aspnet_Users.UserName = @UserName)

asp:Parameter Name="MyField"
asp:SessionParameter Name="UserName" SessionField="UserName"


When I used the above command/parameters, the following exception was thrown:

"System.Data.SqlClient.SqlException: Operand type clash: nvarchar is incompatible with image"

Obviously, I am no SQL expert. Can someone explain where I am going wrong? Any comments on my approach are welcome.


Thanks.
GeneralRe: Problem updating database Pin
Michael Sync30-Dec-07 5:40
Michael Sync30-Dec-07 5:40 
GeneralUnable to work with IIS server Pin
Roney29-Dec-07 7:21
Roney29-Dec-07 7:21 
GeneralRe: Unable to work with IIS server Pin
Michael Sync29-Dec-07 7:51
Michael Sync29-Dec-07 7:51 
QuestionLocal CSS returns a 404? Pin
Mustafa Ismail Mustafa29-Dec-07 6:43
Mustafa Ismail Mustafa29-Dec-07 6:43 
AnswerRe: Local CSS returns a 404? Pin
Paul Conrad29-Dec-07 7:09
professionalPaul Conrad29-Dec-07 7:09 
GeneralRe: Local CSS returns a 404? Pin
Mustafa Ismail Mustafa29-Dec-07 9:32
Mustafa Ismail Mustafa29-Dec-07 9:32 
AnswerRe: Local CSS returns a 404? Pin
Michael Sync29-Dec-07 7:53
Michael Sync29-Dec-07 7:53 
GeneraljQuery & ASP.NET Pin
Mustafa Ismail Mustafa29-Dec-07 3:46
Mustafa Ismail Mustafa29-Dec-07 3:46 
GeneralRe: jQuery & ASP.NET Pin
Michael Sync29-Dec-07 7:56
Michael Sync29-Dec-07 7:56 
GeneralRe: jQuery & ASP.NET Pin
Mustafa Ismail Mustafa29-Dec-07 9:37
Mustafa Ismail Mustafa29-Dec-07 9:37 
GeneralRe: jQuery & ASP.NET Pin
Michael Sync29-Dec-07 17:35
Michael Sync29-Dec-07 17:35 
GeneralRe: jQuery & ASP.NET Pin
Mustafa Ismail Mustafa29-Dec-07 18:57
Mustafa Ismail Mustafa29-Dec-07 18:57 
Questionhow i can hide a row in a grid view Pin
jagan12329-Dec-07 2:54
jagan12329-Dec-07 2:54 
AnswerRe: how i can hide a row in a grid view Pin
rahul.net1129-Dec-07 3:39
rahul.net1129-Dec-07 3:39 
Generalconfig error---------- Pin
smileschandu29-Dec-07 0:59
smileschandu29-Dec-07 0:59 
AnswerRe: config error---------- Pin
Guffa29-Dec-07 3:34
Guffa29-Dec-07 3:34 
Generalcreate pdf file from database table in asp.net Pin
Ravi_2129-Dec-07 0:37
Ravi_2129-Dec-07 0:37 

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.