Click here to Skip to main content
16,006,475 members
Home / Discussions / Database
   

Database

 
GeneralRe: Tracking SQL Server memory usage Pin
19-Mar-02 11:41
suss19-Mar-02 11:41 
QuestionWhere is primary key? Pin
Philip Patrick17-Mar-02 0:37
professionalPhilip Patrick17-Mar-02 0:37 
GeneralADO.NET Pin
Travis D. Mathison16-Mar-02 1:53
Travis D. Mathison16-Mar-02 1:53 
QuestionWhats wrong with this code? Pin
Mazdak15-Mar-02 0:38
Mazdak15-Mar-02 0:38 
AnswerRe: Whats wrong with this code? Pin
James T. Johnson16-Mar-02 20:23
James T. Johnson16-Mar-02 20:23 
GeneralRe: Whats wrong with this code? Pin
Mazdak16-Mar-02 21:24
Mazdak16-Mar-02 21:24 
GeneralRe: Whats wrong with this code? Pin
James T. Johnson16-Mar-02 21:43
James T. Johnson16-Mar-02 21:43 
GeneralRe: Whats wrong with this code? Pin
Mazdak16-Mar-02 23:07
Mazdak16-Mar-02 23:07 
Good morning;)
James T. Johnson wrote:
OleDbDataAdapter myAdapter=new OleDbDataAdapter("SELECT Username, Field1, Field2, .... FROM Table2",myConnection);OleDbCommandBuilder myBuild=new OleDbCommandBuilder(myAdapter);myAdapter.InsertCommand = myBuild.GetInsertCommand();myAdapter.UpdateCommand = myBuild.GetUpdateCommand();myAdapter.DeleteCommand = myBuild.GetDeleteCommand();


I got really nice unhandled exception for last two lineSmile | :) :
Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information.

And after I use that still the same problem remain(it could not update)

James T. Johnson wrote:
// these lines shouldn't be needed anymore because we explicitly defined the fields above// DataColumn[] keys=new DataColumn[1];// keys[0]=myDataSet.Tables["Table2"].Columns["Username"];// myDataSet.Tables["Table2"].PrimaryKey=keys;

I need these lines because I use Find method and I need primary key for it.



James T. Johnson wrote:
At the top of your ASP.NET page change your Page tag to this <%@ Page Trace="true" ....>

Now when you want to output something for debugging purposes use, Trace.Write(strCategoryName, strValueToOutput); The category name is so that you can see what the value is for.

In your case you would put this before the myAdapter.Update(myDataSet,"Table2");

Trace.Write("myAdapter.InsertCommand.CommandText", myAdapter.InsertCommand.CommandText);


Frown | :( I did as you say and nothing appear in output window,also something that I can't describe it mess up the background of page? Confused | :confused:

Mazy

"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here."
Wish You Were Here-Pink Floyd-1975

GeneralRe: Whats wrong with this code? Pin
James T. Johnson17-Mar-02 14:50
James T. Johnson17-Mar-02 14:50 
GeneralRe: Whats wrong with this code? Pin
Mazdak17-Mar-02 20:50
Mazdak17-Mar-02 20:50 
GeneralRe: Whats wrong with this code? Pin
James T. Johnson17-Mar-02 21:56
James T. Johnson17-Mar-02 21:56 
GeneralRe: Whats wrong with this code? Pin
Mazdak17-Mar-02 22:21
Mazdak17-Mar-02 22:21 
GeneralRe: Whats wrong with this code? Pin
James T. Johnson17-Mar-02 22:28
James T. Johnson17-Mar-02 22:28 
GeneralRe: Whats wrong with this code? Pin
Mazdak17-Mar-02 22:41
Mazdak17-Mar-02 22:41 
QuestionHow to connect to MicroSoft Access without creating a DSN in Control Panel? Pin
14-Mar-02 22:48
suss14-Mar-02 22:48 
AnswerRe: How to connect to MicroSoft Access without creating a DSN in Control Panel? Pin
Mazdak15-Mar-02 0:16
Mazdak15-Mar-02 0:16 
GeneralRe: How to connect to MicroSoft Access without creating a DSN in Control Panel? Pin
15-Mar-02 4:04
suss15-Mar-02 4:04 
GeneralADO.NET Pin
Mazdak14-Mar-02 4:31
Mazdak14-Mar-02 4:31 
GeneralRe: ADO.NET Pin
Andres Manggini16-Mar-02 16:39
Andres Manggini16-Mar-02 16:39 
GeneralRe: ADO.NET Pin
Mazdak16-Mar-02 19:59
Mazdak16-Mar-02 19:59 
GeneralRe: ADO.NET Pin
Mazdak16-Mar-02 20:40
Mazdak16-Mar-02 20:40 
GeneralRe: ADO.NET Pin
James T. Johnson16-Mar-02 21:20
James T. Johnson16-Mar-02 21:20 
GeneralRe: ADO.NET Pin
Mazdak16-Mar-02 21:30
Mazdak16-Mar-02 21:30 
GeneralRe: ADO.NET Pin
James T. Johnson16-Mar-02 21:44
James T. Johnson16-Mar-02 21:44 
GeneralRe: ADO.NET Pin
Andres Manggini17-Mar-02 3:18
Andres Manggini17-Mar-02 3:18 

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.