into ReportDetail( Partcipantid, Reportid)
select distinct ParticipantID
, 3 from abc
closed = 0
and ( isnull
View Complete Post
How can I get the numbers of records affected in the Merge statement, INSERT,UPDATE,DELETE separately and store it in a variable so I can get it in the application side?
My requirement is, we have more than 5 database servers, each server lot of databases, each database lot of tables.
I want show the details
In asp or Classic asp.
please anybody help for code and query.
how to split the connection string in asp ?
I couldn't get the total record count in a, in my stored proc, in a given scenario. Please help
My SP looks like this:
create proc RecordCount
@RecCnt int OUTPUT
if(CustomerID = 'ABC')
@RecCnt = select count(*) from Customers where CustomerID='ABC'
@RecCnt = select count(*) from Customers where CustomerID='XYZ' and TranDate > '05/01/2009'
-- This is how I called my SP
declare @rc int
exec RecordCount 'XYZ', @RecCnt = @rc OUTPUT
I have a page that is opened in a popup window from the main page. Once i click insert it pops up a message that says you have successfully added blah blah. Then once you click ok it closes the popup page and goes back to the main page. I want to be able to refresh the main page back to how it was when you first land on the page. Here is the code for my insert button:
style="background-image:url('Images/Button.gif'); text-align:center;background-color:Transparent; cursor:hand; background-repeat:no-repeat; background-position:left; padding-left:15px; font-family: 'Arial Unicode MS'; font-size: small; font-weight: bold;"
Runat="server" Height="25px" BorderStyle=None ForeColor=White Text="Insert"
if i have a prodcut with product no. and each product is made by many parts with parts no.
now i would like to retrieve data to count how many parts to make a product.
in sql, can i count parts no. by each product no. like belows:
select product_no,parts_name,manufacture_date,(select count(*) from item where product_no=p.product_no) as [No. of items] from prodcut p left outer join item i on p.product_no=i.product_no
but i found that the execution time is too long, is it the right way to count no. of item in each product??
I put in break points, the problem starts when I get to this part:
public void InsertClients(string client_name, string client_lastname, int client_age)
cmd = new SqlCommand();
cmd.CommandText = "[dbo].[prcinsert_client]";
cmd.CommandTimeout = 0;
cmd.CommandType = CommandType.StoredProcedure;
cn = new SqlConnection(System.Web.Configuration.WebConfigurationManager.ConnectionStrings["myConnectionString"].ToString());
cmd.Connection = cn;
cmd.Parameters.Add("@client_name", SqlDbType.VarChar, 12).Value = client_name;
cmd.Parameters.Add("@client_lastname", SqlDbType.VarChar, 15).Value = client_lastname;
cmd.Parameters.Add("@client_age", SqlDbType.Int, 4).Value = client_age;
cmd.ExecuteNonQuery(); // problem is here will not execute the query.
throw; // throw it back to the calling method.
I checked I can get all of my values. Here how I save my value in the bll:
public int Save_Client(string clientname, string clie
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
Pardon me, I'm just getting started with C#, but here goes:
I have an asp.net web page that allows the user to insert a new record in a database table named "featured_properties." The table has 3 fields (propID [int], dtDisplay [datetime], and lastdisplay [datetime]). propID corresponds to a unique id in a different table, which contains a field called "name" [varchar].
To insert a new record into "featured_properties", the user chooses a name from an asp:DropDownList, which is populated by the "name" field in the second table. The value of each name option in the dropdown list is the unique id number for that record, which will also serve as the propID number in featured_properties. This part is working fine.
<asp:DropDownList ID="ListOfProperties" runat="server"
So I have a control that will provide a value for the "propID" field in the insert.
For the other two datetime fields (dtDisplay and lastdisplay), I've placed asp:Calendar controls on the page. I would like one to provide the value for StartDate and the other to Provide the valu