.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Random quote of the day

Posted By:      Posted Date: October 11, 2010    Points: 0   Category :SharePoint


I need to create random quote of the day based on date change.




View Complete Post

More Related Resource Links

Generate Random Numbers

SQL Server has a built-in function that generates a random number, the RAND() mathematical function. The RAND math function returns a random float value from 0 through 1.

Generating MS Word doc from mht file gives smart quote problem


I have a word document to be generated using ASP.Net/VB.net.

So I have a word document template saved as .mht file on the web server.

In my ASP.Net code,I read this mht file content and replace certain string line Description$$ with the actual description from the database.Then save this content as .doc file.

This works fine but shows a box symbol when I have smart quotes " (not this one as I cannot type it here.The double quote which you see in MS Word,the slanted double quote).

I dont know how to make my word doc generated, show the exact double quote as in MS word.

If any of you have any idea of this please reply.

Thank you

SSIS XML Source with random child ID??

Hi, I am trying to load a XML document using SSIS into relational tables and pulling my hair out.  In it's simpliest form I have: <Batch>   <POSBasket>     <Header>       <SomeDetail/>     </Header>   </POSBasket>   <POSBasket>     <Header>       <SomeDetail/>     </Header>   </POSBasket> </Batch>   Now, when you have a parent child situation, you get a column in the output called xxx_Id, in my case, POSBasket_Id. This allows you to relate your header back to your root and SomeDetail back to header etc etc. Loading all of this in parrallel does not work because there is nothing unique once the load has happened more than once. i.e. You will have repeating POSBasket_Id's as well as Header_Id's. I ended up loading POSBasket into a table with an identity column. Once done, I would load the header details and do a lookup (eek) on the POSBasket table by using POSbasket_Id "where isComplete = 0" (A flag to tell me current import). Great, this works find with 1 item in my document. Add a second (2 POSBaskets) and it randomly works. (???) Add more and it hardley works. The look ups are failing with "no match found".   On using Data Views, I see that each XML source creates different POSBasket_Id's. Some matching, some not. Also seem to randomly match. My question is why? Why would there be t

XML Column containing single quote causes replication error

We have SQL Server 2005 transactional replication set up, and some of our tables have XML datatype columns.  We have run into an issue with the following error in the publication: Incorrect syntax near 's'. (Source: MSSQLServer, Error number: 102) Get help: http://help/102 Looking at the distribution database, I was able to extract the offending command, and it turns out that the XML column has a single quote (') embedded in it, and the command that was generated for inserting the row into the subscriber table has bad syntax because of the single quote (i.e., it is not escaped).  One interesting note is that the single quote happens to also show up in a non-XML column, and the command segment for that column was generated correctly (it was escaped). Is there a workaround / solution for this?

Update with unique random generated values.

Hi there, I have an issue with an update of a column with unique random generated values, using SQL 2005. What I want to achieve is to create unique username for a list of let's say 1000 rows. My approach, which may be wrong, is as follows: to create a view to retrieve a random generated number of 7 digits; to use a function that retrieves the number from the view and checks if it is unique in the table or not (if it is, the number is returned, if it is not, a new one will be generated and so on); to update the table using that random generated number. The problem is that it does not work. It does not generate unique numbers, not all the times (you have to test by running the code few times). I suspect it is something with the update, but not sure how to solve it. Here are the steps to reproduce the problem. Create the table: CREATE TABLE [dbo].[TB_Temp]( [ID] [int] IDENTITY(1,1) NOT NULL, [ADM_USERNAME] [nvarchar](7) COLLATE Latin1_General_CI_AS NULL, ) ON [PRIMARY] Add some test rows: DECLARE @i INT SET @i = 0 WHILE @i <= 1000 BEGIN INSERT INTO TB_TEMP (ADM_USERNAME) VALUES ('') SET @i = @i +1 END Create the view to random generate 7 digits numbers: CREATE VIEW vw_RandNumberForAdminUserName AS SELECT ROUND((9999999 - 1000000 - 1) * RAND() + 1000000, 0) AS RandNumber Create the function to retrieve the unique 7 digits number: CREATE FUNCTION [dbo].[fn

String StartWith double quote

hi all,my string variable first character starts with " now i want to check whether it has " or not. how to check this from Code Behind.

How to show random information with C# from a SQL Database?

I have to do the following in my web page.  Any advice and how to do this please with C# I have a table where I have a column for different states (NY, NJ, etc).  People can join the group (in my page) for each state (the state where they live).  So I have to display the newest members for each state. So the way it should work is, every time the page is refreshed/reloaded it should show the state name as a header text and the first 5 newest members for that state.  This should be random, for example initially when the page is loaded say it will show state: New York and the 5 recent members like Stacy, Laura, Mike, Sam, Mathew. Then when the page is refreshed it will show another state like State: california and the recent 5 members All the information comes from the database How should I do this?

Select random 10 records in sql server 2005 in terms of time

Hello,i have a query that select random records in access database in terms of time : "SELECT TOP 10 * FROM Tbl ORDER BY Rnd(-10000000*TimeValue(Now())*[ID])"now i wish to convert this query for using in sql server 2005 such that return random records in term of time 

SharePoint Designer random issues

I have designed a workflow which sends an email to the "Created By" user account.  Out of 124 submissions, 10 have errored out showing that the user account is not correct.   Domain\user points to email account user@company.com However, there are times which the workflow sends the email to "LastName ; FirstName MI." instead... Any ideas as to why this would be happening?

Datareader: Set multiple random images into appropriate image field

Hi, first of all, sorry if my title isn confusing as i dont really sure the specify description regarding what i wan to do.   Now what i trying to do is, I getting 5 random images from the database, this is the code for me to get random 5 records from database: Dim command As New SqlCommand("SELECT TOP 5 Description,Image,ImageID FROM Properties ORDER BY ImageID", con)  and with the help of image handler to display it to 5 Images components i put in the page, lets say name it "Image1" to "Image5". Now the question is, how do i assign the 5 diff imageID into the 5 image components? Lets say i wan my Image1's imageID is 1, and Image2's imageID is 2. What im doing now is assigning all the same imageID to all 5 images. Below is how i assign the imageIDDim reader As SqlDataReader reader = command.ExecuteReader If reader.HasRows = True Then While reader.Read Image1.ImageUrl = "GetThumbnail.aspx?ImageID=" & reader("ImageID") & " " Image2.ImageUrl = "GetThumbnail.aspx?ImageID=" & reader("ImageID") & " " Image3.ImageUrl = "GetThumbnail.aspx?ImageID=" & reader("ImageID") & " " Image4.ImageUrl = "GetThumbnail.aspx

Search results page showing random characters instead of item's description

I have an email-enabled document library that a few Japanese people email PDF files into (all external to the company). When I search for any PDF file sent from particular email addresses, the search results page displays random characters instead of the item's description. Here is an example: From Screen shots These characters don't appear for all email senders, just some of them. Our MOSS site is in English and we don't have any language packs installed. The PDF file contents are also in English. Can anyone point me towards a solution for this?

Stock quote ticker and chart

Hello folks,   I want to include a stock quote ticker and chart into my asp.net website using c#. Basically its a financial portal and want to give stock info to the customers..so any heads up?I checked out online..but didnt find anything that much interesting..neways pls try to help me if you can..thanks in advance :)

create RandomNumber from 1 - 100 by prssed random button

How I can create RandomNumber from 1 - 100 by prssed random button   can you help me as soon as possibel I have an assignment   Thanks Yousf  

Random Access Denied Messages / Logging Question

Some users are getting random access denied messages. They will be working in a site, click on a link, and get access denied. Come back a couple minutes later and everything will be fine. Is it possible to fine tune logging to capture these access denied messages? Thanks for taking the time.

XCOPY deployment of WCF application produces random exceptions

We are using a simple self-developed XCOPY-like tool for copying the binaries etc. of a WCF application directly into the physical folder of a virtual directory on IIS. After the deployment the application randomly throws an excetion ("The ObjectContext instance has been disposed and can no longer be used for operations that require a connection"). I know that this is EF related (we are using EF for data access purposes within our WCF services) but donÄt think it has anything to do with EF.However, the exception occurs absolutely without any pattern. Starting our app multiple times results in the excetion sometimes but it succeeds immediately afterwards. I even restarted the IIS windows service but the same phenomenon still exists afterwards.When I use the "Publish" dialog from VS2008 for the deployment everything is fine. However, we need to do the deployment through our script as we have a staging location between our dev and prod environments.What do we have to to in order to make a successfull and reliable XCOPY deployment and get rid of this strange behaviour?

VS2008 - please fix automatic quote inserting finally

I quickly searched Connect and didn't find any related complaints or bug reports but for me, it is a real pain to edit HTML code by hand inside Visual Studio. The main reason is that the source editor almost always inserts (or omits) quotes when they should be omitted (or inserted). Here is how it usually goes: head down, typing <p class="red">, head up - the editor is displaying <p class=""red"">! Fix it. Head down, typing.... it did it again! So I turn off "Insert attribute value quotes when typing", type in runat=, press Enter to select server from IntelliSense's drop-down and oops - the quotes are not there! I know that I can learn what to expect when this setting is on or off but there are plenty of editors (mostly from Java world) that "just work". Take Eclipse, for example: I type in <p class= and the editor inserts two quotes automatically. If I start writing some letters, it will be just fine but if I press quote because my head is down and I didn't notice that the IDE was too clever, Eclipse will simply ignore my key stroke. Then, when my cursor is here: <p class="myClass|" and I type quote, again, it will have the same effect as pressing right arrow on my keyboard because Eclipse recognizes that the quote is already there. Very simple but very helpful. Please implement this f

how to double quote a control?

 How would I put quotes on the DataLink control so it outputs "\ \computer\folder" (i put a space in there between the \\ so it would show up) instead of just \\computer\folder   it generates a link but if the folder name has a space it in the link breaks so i am trying to put double quotes on it so it creates a link even if there are spaces.  Dim DataLink As New TextBox DataLink = FormViewDC1.FindControl("CDR_Data_LinkTextBox") mail.Body = "Your CDR ID#" & cdrID.Text & " status has been updated to: " & Status.Text & "<br /><br />" & "Data Location:<br />" & DataLink.Text & "<br /><br />" & "Comments:<br />" & Comments.Text & "<br /><br />This is an automatically generated email, please do not reply."  
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend