View Complete Post
Normally the code below works, EXCEPT if the xpath doesnt exist, then I get the error "Object reference not set to an instance of an object." on the 2nd lineDim sessionXML As XmlDocument = Session("XML")If sessionXML.SelectNodes("//root/data/compare/locations/location") IsNot Nothing ThenHow can I check if the xpath exists (without a try catch preferably)?
Dim request = System.Net.WebRequest.Create(New Uri (fileURL))
request.Method = "HEAD"
Dim returnURL = ""
Dim response = request.GetResponse()
returnURL = fileURL
Catch ex As Exception
I want to check first to see ifthe xyz.bak file exsits before I perform a backup.
I would like to check and see if a record exists before doing an insert. Here is the code I have tried:
Partial Class template
Private Shared prevPage As String = String.Empty
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
If (Not IsPostBack) Then
prevPage = Request.UrlReferrer.ToString()
Protected Sub btn_Volunteer_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim IDProfileVolunteer As String = Session("IDProfileVolunteer")
Dim IDProfileOrganization As String = CType(FormView1.FindControl("hf_IDProfileOrganization"), HiddenField).Value
Dim conn As SqlConnection
Dim cmd As SqlCommand
Dim strconnection, strsqlinsert As String
Dim currentUser As MembershipUser = Membership.GetUser()
Dim currentUserId As Gu
I want to create a module I can reuse that will let me pass in a list object and field name to check to see if the column exists. What would be the best way to do this in terms of performance? I've read some things about looping through every field in a
list is unnecessary but I'm not sure how else to go about it.
I have 2 tables:
- Salesmen with Pk.SalesmenID
- Appointments with Fk.SalesmenID and busy(bit)
How can I check if every salesmen has at least one appointment
Am I on the right way with statement below, though I got syntax problems
(SELECT COUNT(distinct SalesmanID)FROM Appointments)
(SELECT COUNT(SalesmanID) FROM Salesmen)
I have a table that holds insurance types 1 -5, these are layered, the person must have type 1 before any other type. We dont have a front end yet so users enter directly in the table, i would like to create a check constriant so that if a user trys
to enter a type 2 and there is no type 1 for the client the record will be kicked out.
Any help appreciated.
var strUsers = new Array("John","Mac","George");
The above declaration is for sample and the number of items vary.
How to check, if the particular loggedin user for example: Mac is available in the arraylist.
heys all i was wondering if we do if not exists(select*from information_schema.tables where table_type='base table' and table_name='tbl')
is it slower than if not exists(select 1 from information_schema.tables where table_type='base table' and table_name='tbl')
because we select less things in the inner query?