473,320 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Getting formated SQL

With the code below :

SqlParameterDictionary sqlParamDic = new SqlParameterDictionary();

StringBuilder sqlBuilder = new StringBuilder();

string sql;

sqlBuilder.Append( "insert products (product) ");

sqlBuilder.AppendFormat( "values (@name) ", product.Name);

sql = sqlBuilder.ToString();

sqlParamDic.Add( new SqlParameter( "@name", product.Name ) );

SqlHelper.ExecuteNonQuery( GlobalFunctions.GetConnectionString(),
CommandType.Text, sql, sqlParamDic );

How can I get the SQL witch framework used to insert into the database? When
I check at commandtext, its still with the placeholders.

Emerson
Jul 21 '05 #1
1 1175
You can use the Sql Server profiler to see what the actual values are.

--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Emerson Yukio Honda" <ki******@yahoo.com.br> wrote in message
news:uR*************@TK2MSFTNGP09.phx.gbl...
With the code below :

SqlParameterDictionary sqlParamDic = new SqlParameterDictionary();

StringBuilder sqlBuilder = new StringBuilder();

string sql;

sqlBuilder.Append( "insert products (product) ");

sqlBuilder.AppendFormat( "values (@name) ", product.Name);

sql = sqlBuilder.ToString();

sqlParamDic.Add( new SqlParameter( "@name", product.Name ) );

SqlHelper.ExecuteNonQuery( GlobalFunctions.GetConnectionString(),
CommandType.Text, sql, sqlParamDic );

How can I get the SQL witch framework used to insert into the database?
When I check at commandtext, its still with the placeholders.

Emerson

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Alexander Hoffmann | last post by:
Hello, Recently I was debugging a memory leak in my app and finally figured out that I had to manually implement destructors for some classes. While debugging I wrote a method that prints the...
3
by: Don Grover | last post by:
Hi I have to return dates formated in different ways in an asp page from sql server. What function can I use or how can I return dates formated like so I tried DATEPART ie.. but that does not...
0
by: Rolf Kemper | last post by:
Dear Experts, I want to send a formated query result by mail. I'm running SQL Server 2000 1) How can I achieve that the printed length of a field is based on the minimum required length to...
31
by: Thanos Tsouanas | last post by:
Hello. I would like to have a quick way to create dicts from object, so that a call to foo would return obj.bar. The following works, but I would prefer to use a built-in way if one exists. ...
1
by: hswerdfe | last post by:
I was wondering if someone could point me to a tutorial or API Doc that would be useful for manipulating poorly formated html returned through an an XMLHttpRequest Object. like something that...
11
by: David Messner | last post by:
Ok I know this is simple but the statement eludes me... I have a date field where I want the default value on the data entry form's date field to be the last date entered. I figure I can do this...
0
by: Pete Smith | last post by:
Hi, does anybody know a comfortable editor which creates StyleSheets to transform xml to well formated hmtl (e-mails) Thanks in advance for any hint Pete -- Pete Smith
3
by: sb Luis | last post by:
I Use the following code to read from MS Word, but I couldent read Formated Text (RTF). How Can I read formated text from MS Word Doc without using clipboard. thanks. Word.ApplicationClass...
3
by: lialie | last post by:
Hi, Is there a fine way to read a formated file like: %HEADER title = "Untilted" username = "User" %DATA ....... ....... The formated file may be very popularly, but the module ConfigPaser
0
by: pjnambiar | last post by:
Hello friends anyone have idea of converting a formated PDF file into msaccess or excel file. Formated in the sense the informations within pdf file are tabled with different colums. P.J.NAMBIAR
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.