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

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

How to check for exist word before inserting?

Posted By:      Posted Date: October 27, 2010    Points: 0   Category :ASP.Net

This is what I have at the moment.

insLusHmoobDataContext lusHmoobDC = new insLusHmoobDataContext();

lusHmoob lhbLusHmoob = new lusHmoob();

lhbLusHmoob.wordID = Guid.NewGuid();
lhbLusHmoob.word = txtWord.Text;
lhbLusHmoob.usage = txtUsage.Text;
lhbLusHmoob.hmgTrans = txtEnglishTrans.Text;
lhbLusHmoob.engTrans = txtEnglishTrans.Text;
lhbLusHmoob.originate = txtOriginate.Text;
lhbLusHmoob.modDate = Convert.ToDateTime(DateTime.Now.ToLongDateString());
lhbLusHmoob.insertDate = Convert.ToDateTime(DateTime.Now.ToLongDateString());

Is there a way to check if the word already exist in the database before the insert is commited? Can I somehow incoporated into this Insert or do I have to do my verification separately?

View Complete Post

More Related Resource Links

Check in dialogue does not show when closing word


In a document library that has check in and check out required a user on this network found that when they close word after editting a document, there isn't a dialogue asking whether a user wishes to check a document in.

This is how it normally works and without the dialogue there's all the likelyhood that many documents wont be checked in.

I did some testing and i found that the SharePoint drafts folder is located on a network drive. If i uncheck the box that says use local drafts folder on one of the dialogs that appear when openning a document then asks me if i want to check in the document when i close word, if i change the default location of the sharepoint drafts folder to a local folder then the dialog appears also. I can only assume there are some ACL's or File system atributes that tell word that the document needs to be checked in and those attributes are not read correctly if the document is on a network drive (perhaps ACL's are locked?).

You can change the default location with regedit or in one of the office programs so i was thinking that perhaps we could roll out a registry setting in the login script to default the sharepoint drafts folder to a local one, any other suggestions?

How can i check if record already exist in sql-server database ...

How can i check if record already exist in sql-server database ...

>>>Check duplicate while inserting record from Texbox.

Hi, On inserting record, I want to check that for example if a user enters a telephone number for any record is already in the database then it should validate that the number already exists in table and you cannot enter a duplicate value. Then if user will provide some other telephone number then he allows to insert record. For insertion of record I used ObjectdataSource. User will enter telephone number in a simple textbox. I may want to inform that I am working in asp.net2.0 and also not allowed to use any third party control or ajaxtoolkit. Any idea would be appreciated.

Inserting Foreign Key Value if it doesn't exist?

I am inserting a record and want to set the value for a foreign key but I am getting an error - I initally thought that it would insert it if it didn't exist but I must be wrong and want to confirm that I need to check all values and make a record for them if they don't exist... here's what I am trying to do - does his make sense?var newAllPart = new Part();                newAllPart.PartNumber = partNumber;                newAllPart.Manufacturer.ManufacturerName = partManufacturer; // error here if the Manufacturer doesn't exists already                newAllPart.PartType.PartTypeName = partType;                newAllPart.Category.CategoryName = partCategory;                newAllPart.DateCreated = DateTime.Now;                newAllPart.UserCreated = userCreated;                newAllPart.Package.PackageName = partPackage;    

Document is read-only in SharePoint, but user sees "check out" option in Office 2007 / Word / Excel

I am finding that when there is a document library in SharePoint with checkin/checkout required, if a user with read-only ("Visitor") permissions opens a document from that library, the document will open as read-only in Word, Excel, etc., but the user will see the "Server Document" bar with the message "To modify this document, you must check it out" and the "check out" button.  When the user tries to check the document out, they are asked to authenticate, and then receive the error "Cannot perform this operation.  The file has been deleted or someone else has it checked out."    How is it possible to prevent a user with read-only rights in SharePoint from seeing the "Check out" option in Word or Excel?

Using custom code on report services to check if directory does exist or not (need help)


I am trying to check if a directory does exist.  I have used the vb.net to create a very small function and embedded into the "Custom code:" section of Report Properties.  It’s output is a return of Y or N (string) or 1 or 0 (Integer) if directory exist or not. 

Here is the code which returns a String

    Function ifDirExist(ByVal mypath As String) As String

        Dim flag As String

        If Not System.IO.Directory.Exists(mypath) Then

            flag = "N"

Check to see if items do not exist


I basically have 3 queries that I need to run to provide specific answers to my users.  Whether the machine is Running(Deployed), Not Running(Available) or "In Maintenance"(Unavailable).  The first and third queries run fine.  However the second one (in Bold)is where I'm having additional trouble, it needs to check to see if the Machine is "In Mainenance" or not.  If it is not in mainenance then it should get its value from the Designated amounts Table, Else it should give the value of '0'

Problem Query

"Not Running" but able to if needed.
Needs to check to determine if it is Available(i.e. Not Running) ("SELECT  TOP (1) CASE WHEN V300938F <= '.1'") it then needs to check to see if it matches this Criteria  "WHERE   (dbo.Designated_Amount.Unit_Code = '114') AND SIMS.Event_Type in ('IR','ME','MO','PE','PO','RU','SF','U1','U2','U3') AND (dbo.SIMS.EventEndTS IS NULL) AND (dbo.SIMS.Avail_Cap = 0)" then it should return a '0', if it doesn't match the Where clause it should return the value from the Designated_Amounts table.

declare @Amount float

select top 1 @Amount =  CAST(dbo.Designated_Amount.Amount AS Float)

Inserting "Modified By" Information from SharePoint into Word 2007


In Word 2007 I'm able to include the Name and Date in which a user last saved a document by taking the following steps:

Click the Insert Tab -> Quick Parts -> Field, and then selecting LastSavedBy and SaveDate respectively.

My problem is that the LastSavedBy name displayed is in the form of their username (first initial, lastname). I need to have it displayed as it is in the Modified By column in SharePoint (full first name, last name).

My question is, how do I pull in the Modified By information from SharePoint into the Word document?


How can i check the uploaded document is already exist, in Library


  I want to restrict the user in uploading the file to library, if the uploading file is already exist. I upload all the document in the RootFolder of  Library and it contain 1000's of document. How can i check the uploaded document is already exist, programatically. 

Check if Site, Document Library or Folder exist


Hi All,

I need some code using the webservice to check if a Folder, Document Library or SubSite exist. The purpose is basically to check if it exists before trying to create it.

I've found that I can detect a Document Library (but not Site or folder) with this:

  • list.Url =


  • XmlNode


    list = list.GetList("MyDocLib");

It returns some information if found one and an error (Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-

How to check the document already exist in the Document library


  I am inserting a document in a library, while inserting a document i want to check this document is already in my document library. how can i do this using custom webpart.

Inserting a document ID into a word document


Hi all,

I would like to have the document ID embedded in the footer of word documents automatically.  Once a document is created I can insert the value (Insert | document properties | Document ID : Value) without a problem.

What I would like is to do this in the document template, but the Document ID: Value isnt available (as I guess its not been created yet).  I could use a workflow to update the document after creation but I wondered if anyone has a smarter way of acheiving this?






Using a CompareValidator to check input is a valid date

The CompareValidator can do more than just compare two controls. You can also compare it against several of the main .net data types such as Date, Integer, Double and Currency.

To do this you would set Operator="DataTypeCheck" and instead of setting the ControlToCompare or ValueToCompare attributes as you normally would you use the Type="Date" (or any of the data types I have listed above).

Inserting new row in GridView in ASP.NET 2.0

The GridView was not designed to insert new rows, but there is a way to accomplish this with very little code. This article shows how to do that. The GridView was not designed to insert new rows, but there is a way to accomplish this with very little code.

Check All with JQuery and a Asp.Net GridView

Display a Grid on the screen with a checkbox in each row. At the bottom of the page have "Check All" button.

Typically if I need to do anything interesting I use a template column. So my GridView will look like the one below (most other columns removed for readability). The only interesting point to note is the CssClass="ApprovalCheckBox" in the CheckBox ItemTemplate.

PrintPocketCE Print Pocket Excel, Pocket Word and email files

Version 3.560 (May 15, 2009):

Important bug fix: a slight difference in how some devices create fonts was causing a few devices to have significantly longer print times for large print jobs.

Adjusted PocketJet printer paper feed commands

Other minor fixes and enhancements.

Version 3.559 (Mar 5, 2009):

Added support for Martel MCP78xx printers

Version 3.558 (Aug 20, 2008):

Added support for Martel MCP78xx printers

Version 3.557 (June 27, 2008):

Fixed error in Canon printer support

Fixed COM0 port selection

Version 3.556 (June 15, 2008):

Added support for Brother MW-260

Added support for Sato MB400

Version 3.555 (Aug 8, 2007):

Added support for Pentax RuggedJet 3 and RuggedJet 4 printers

Changed Epson TM-P60 support to maximum page width of 1200 dots

Version 3.551 (Aug 1, 2006):

Added Peripheral Nomad printer support

Version 3.550 (Mar 23, 2006):

Added Panasonic JT-H200PR printer support

Added Pocket Spectrum printer support

Fixed problem with WM5.0 "inverted image" problem

check box control


Hi ,

I have a three check box in my web form ,i need to choose only one check box, if i choose one check box

another 2 check box automatically unchecked

can i use jquery for check box

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