473,387 Members | 1,859 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,387 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 1177
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.