convert to string #2

i want to convert to string an integer value which i'm receving from database, in an SqlDataReader, how to do this?


SHASHANK BHIDE
CAPGEMINI INDIA
"THE ROAD TO SUCCESS IS ALWAYS UNDER CONSTRUCTION MARK MY RESPONSE AS ANSWER TO HELP ME BUILD IT :)"
0
shashankgwl
2/28/2009 8:06:26 AM
asp.net.getting-started 91979 articles. 4 followers. Follow

7 Replies
527 Views

Similar Articles

[PageSpeed] 13
Get it on Google Play
Get it on Apple App Store

 you can use the toString() function.. for e.g. objreader["columnname"].toString()

 


The real voyage of discovery consists not in making new landscapes, but in having new eyes
0
sreejukg
2/28/2009 8:22:52 AM

shashankgwl:

i want to convert to string an integer value which i'm receving from database, in an SqlDataReader, how to do this?

 

Hi,

If you mean to say that you want the integer value coming from the database through sql datareader in string format, then you can try like this:

  string var = (rdr["database_value"]).ToString();

 

If I am wrong then please let me know....

 

Regards

sneha Smile


Please: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue.
0
snehachoudhary79
2/28/2009 8:28:30 AM

Hi try this way

 

string name = reader["colmn name"].tostring();

or

string name = (string)cmd.exectureNonQuery();

Hope it helps

Best Regards


life is name of learning!
Mark as an answer if it helps
0
Rameezwaheed
2/28/2009 8:33:03 AM

No, u r absolutely right, such an amazing answer, worked at one go......... Party!!!


SHASHANK BHIDE
CAPGEMINI INDIA
"THE ROAD TO SUCCESS IS ALWAYS UNDER CONSTRUCTION MARK MY RESPONSE AS ANSWER TO HELP ME BUILD IT :)"
0
shashankgwl
2/28/2009 8:52:19 AM
Please let others build under construction roads to their success too by marking the answer
Regards
Joseph James
www.beforeyoubuy.co.uk
0
josephjames
2/28/2009 9:00:03 AM

 SqlDataReader sdr=cmd.ExecuteReader(......)

........

  sdr["your_column_name"].ToString()  //conversion of column value to string.

 


News & Reviews | Matrimonial | Mithila

0
hs_jha
2/28/2009 9:08:23 AM

 

number to Varchar 

select to_char(1) from dual;

:)


SSN
Please remember to click "Mark as Answer" on the post that helps you.
0
suthish
2/28/2009 10:14:51 AM
Reply:

Similar Artilces:

Converting classic to .NET 2 code, and .NET gets an error back from ADS?
 For future-proofing, our Internal Phone Directory is being moved onto our AD servers, and obviously we're using LDAP for queries.To get the phoneboook queries working, I adapted the current classic ASP code to use LDAP, and that works fine. However, we're wanting to move these pages to .NET, and that's where the problem comes in. Using the same basic logic from the Classic code (90% of its unchanged) to produce an LDAP query, I get the error  155 Unknown error (0x80005000)This is using the same website, and so the same credentials  - unless aspx pages run und...

.net 3.5 convert to .net 2?
 how can i convert in Web Developer 2008 .net framework 3.5   to .net 2 ? KAHREDEN HAREKET ENGELLENNEMEZ  Hi,If you have not used any .NET 3.5 controls, you simply need to remove all references to .NET 3.5 within the web.config. I hope this helps, if it answers your question, don't forget to mark it as such for those who come afterwards.Regards,Gareth ChidgeyManaging DirectorPushInternet Ltd  ok.how  can i create new web site in web developer 2008 at .net framework 2  .    KAHREDEN HAREKET ENGELLENNEMEZ  try this http://we...

Why Visual Studio 2005 ask me to convert a solution already got converted Somebody did the conversion of a solution from .net 1.1 to .net 2.0 by using the automatic conversion wizard of Visual Stu
Why Visual Studio 2005 ask me to convert a solution already got converted Somebody did the conversion of a solution from .net 1.1 to .net 2.0 by using the automatic conversion wizard of Visual Studio 2005. Then, he changed to another company. Now, I take over his job. Unfortunately, when I attempted to open that solution, Visual Studio 2005 prompted me the conversion wizard again to forced me to perform a conversion on the solution. Does someone know why?--Harish Patel www.MicrosoftSQLandASP.netpatelharish@gmail.com Hi, How many projects are in the solution, does it have UNLOADE...

Is it possible to convert .do net 2 back to .net 1?
I have this application that runs fine on my pc, in which I run VS.Net 2005. When installed on a server with .Net Beta 2 a run time error referring to the line <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">in the web config file comes up. The server does not recognise that line of code, it seems to be still using .NET 1.Any ideas on how to fix that problem without installing VS.NET 2005 on the server?ThanksRaquel Install the .NET 2 beta 2 runtime on the server (if you can), then go into IIS  Manager and you should have a  ASP.NET  tab, w...

Differences between .net 1, .net 1.1, .net 2.0 and .net 3.0 #2
Hi, This seems to be a common question, but i havent got an answer yet:(Can, any one please explain me the differences between these versions.If you keep your feet firmly on the ground, you'll have trouble putting on your pants! There are too many differences for one email - - from 1.0 to 1.1 (not a whole lot of real change, other than fixes, at least compared to 1.1 to 2.0) With 2.0, there were many new declarative controls, with many new ideas added in With 3.0, it's a superset of 2.0 - instead of replacing the installation completely, it just 'added on' new functionality - I would...

CrystalReportViewer problem after converting from .NET 1.1 to .NET 2.0
After converting my web aaplication project from .NET 1.1 to .NET 2.0, I am getting the following error when trying to run reports (and even in the VS 2005 designer):The base class includes the field 'crvBCSOnHandReport', but its type (CrystalDecisions.Web.CrystalReportViewer) is not compatible with the type of control (CrystalDecisions.Web.CrystalReportViewer)Has anybody else had this problem after converting?Thanks,Sacha...

Convert VB.Net to C# with C-Sharpener For VB 2.2
C-Sharpener For VB automatically converts VB.Net projects to C# projects through a Visual Studio Add-in. It has a simple to use Wizard interface and typically converts 99%+ of the VB.Net code. You can download a free trial version.We have just released version 2.2 which increases the trial size limit from 500 to 1000 lines of code. We have also improved handling of manifest files, long project paths, Visual Studio 2005 installation, and more.You can find out more athttp://www.elegancetech.com/csvb.aspxRoger JackPresidentElegance Technologies, Inc....

Getting error while converting string to double: Input string was not in correct format
Select Case LocalMeasuringUnitText Case "Currency" 'do the conversion hereDim ConversionRate As Double = GetConversionRate(_LanguageID)   Dim UKValue As Double 'String.Format("{0:c}", SelectedRow(rowloop).Item("TransData").ToString()) Dim varValue As Object = NothingDim Stringvalue As Object = SelectedRow(rowloop).Item("TransData").ToString.Trim 'varValue = Double.TryParse(Stringvalue, varValue) 'CType(Stringvalue, System.Double) 'UKValue = Convert.ToDouble(Stringvalue) / GetConversionRate(ConfigurationManager.AppS...

Why do i loose all styles when i convert form .net 2.0 to .net 3.5 ?
Hi i converted my application form vs05 (.net2.0 ) to vs08 (.net3.5) and my styles and colors have all gone . for example i hada colors on my page and all of a sudden when i view the page in vs08 the colors arent there . But the .css file is stil part of my solution and when i look at the markup the control still references the class in the css. its as if it's ignoring that class . (is the markup language style overriding the css class) any ideas as to why this may be happening ? thanks robby Hard to say without seeng how are you applying the stylesheet. Can you post markup here?T...

Getting started #2
I've purchased "Learning Perl" to finally give picking up perl a fair shot. However in the beginning of the book it suggest that I should have an understanding of basic programming concepts such as variables, loops, subroutines, and arrays... Well, I don't. I was hoping that this book would somewhat cover it all. I have some experience with bash, not much.. More less copying/pasting scripts and perhaps a slight edit here and there. Nothing that has reveled itself as one of the above functions. So, can anyone recommend a good document/book/link to get the basics...

used a c#.net to vb.net converter and am now getting a syntax error.
ok I used a cool utility at http://www.kamalpatel.net/ConvertCSharp2VB.aspx to convert some c#.net to vb.net and it spit out a bunch of code which almost works but I am getting a syntax error on this line Imports (StreamReader sr = Shadows Function)() As StreamReader(objResponse.GetResponseStream()) I tried it that way and also like Imports (StreamReader sr = Shadows Function)() As StreamReader(objResponse.GetResponseStream()) but either way gave the same error Compiler Error Message: BC30035: Syntax error. Source Error: Line 26: Line ...

getting started #2
Name: Dave Johnson Email: johnsonatfuntechdotcom Product: Minefield Summary: getting started Comments: Just installing for the 1st time Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a2pre) Gecko/20070122 Minefield/3.0a2pre ...

Get 2 Strings
Hello,I have a string which has the following format (I give 2 examples):"FirstWord468x60SecondWord""FirstWord5x172SecondWord"I need to get the numbers 468 and 60, or 5 and 172 into strings FirstNumber and SecondNumber.How can I do this?Can I use a Regex?Thanks,Miguel You could use regex, by using the regex \d+x\d+.Brian"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4). using regex to determine if the string match the format, yeah that's d...

Get String #2
Hello,I am defining the following:Dim Names As String()Consider the following:A = {a, T}B = {b, T}C = {c}Every time I create Names string() I will define it as a value and T or just a value.Basically, I need to get the value a, b or c to a string Name.For example: for A: Name = a for C: Name = cHow can I do this?Thanks,Miguel     I think you need to re-word that in a practical real life scenario instead of using letters.  It doesn't make any sense.Josh Stodola ← Come check out my blog! :-)Ok, given a String Array with 1 or 2 elements how can I get the one which va...

Web resources about - convert to string #2 - asp.net.getting-started

File:Convert to SVG and move to Commons.svg - Wikipedia, the free encyclopedia
As a courtesy (but not a requirement), please e-mail me or leave a note on my talk page if you use this image outside of Wikipedia. Thanks! As ...

Facebook Co-Founder Dustin Moskovitz Sells 450K Shares, Converts 7M More
The great Facebook stock sale frenzy continues on with a report that Co-Founder Dustin Moskovitz unloaded 450,000 shares in the social network ...

Facebook Announces “App2User” Liquidity Program for Merchants to Convert Rewards Points into Credits
... for Credits, just announced a new Credits program called “App2User,” designed to enable merchants and loyalty program operators to convert their ...

How to Convert Leads Into Buying Customers - The 9 Step Sales Process EVERYONE Should Use
... School of Business in Toronto on the topics of Sales and Entrepreneurship. I shared with them the sales process that I find How to Convert Leads ...

Bitcoin : Should I convert my savings to Bitcoin?
Answer (1 of 7): You should think of this question as "Should I invest all my savings in Bitcoin?", and not "Should I have my savings denominated ...

Convertizo 2 - Convert Units and Currency in Style on the App Store on iTunes
Get Convertizo 2 - Convert Units and Currency in Style on the App Store. See screenshots and ratings, and read customer reviews.

Catholics should not convert Jews, says Vatican, in push against anti-Semitism
... 50 years since the Vatican's repudiation of the concept of Jewish guilt for Jesus' death.  Vatican City: Catholics should not try to convert ...

Opinion: These 5 things made me a happy iPad Pro convert
... like I needed a bigger device. But after three weeks with my iPad Pro, several things have changed my mind, and I’m officially a happy convert ...

Today’s apps gone free: BlockBear, Stock Grader, PDF Smart Convert and more
Block ads and other annoying content, take the emotion out of investing, and convert almost anything into a PDF with todays collection of apps ...

Ford patents rear wheel that converts into a unicycle
Filed under: Government/Legal , Green , Ford , Green Driving , Motorcycle , Electric Ford is thinking about allowing drivers to remove a rear ...

Resources last updated: 1/5/2016 8:17:32 AM