I am observing a rather strange behavior. I have a procedure which selects a field from a matching record and returns it. The procedure works as expected returning proper values, when I execute the procedure from Visual Studio Server Explorer tab. The procedure is
[Code]....
This is being called from the DAL as follows:
[Code]....
The problem is if @ReturnValue is EAE then cmd.Parameter[outputParameterKey].Value is giving the value "E". If @ReturnValue is "Sassyboy" it is giving "S". why this behavior?
I have created a stored procedure that reset my tables' identity value. The store procedure works fine when I didrectly run it in my ms sql server 2008. It reset my table Identity value However, when I call it from my function reset, it returns -1, and does not reset my table identitity value. The function to restet my identity value is:
[Code]....
My stored procedure is
[Code]....
To call the the function:
Dim result As Integer = util.resetTableIdentity("myTable", "id", 60) util.print(result)
I got result is -1, and it does ot reset my table identity. Why? How to resove it?
I used this code it’s worked. But I want when Id exist then output any parameter equal 1 else 0. because I have two button Add and Continue.
CREATE PROCEDURE InsertName @Id INT = NULL @Name VARCHAR(50)= '' as BEGIN IF NOT EXISTS(SELECT Count(Id) FROM ParsonTable WHERE Id = @Id) OR @Id IS NULL
i have update sp for users table ,,, i want to store in "Transactions Table" which exactly the fields updated and what is the old value and new value ,, just the updated !!look at this sp code : [Code]....
my question is :'@@column-name' i want to return the parameter for example ---> @user_name ,,, but how ?
I have a stored proc. that returns the USL & LSL values for each of the 8 different Metrics. say, Defect Density (Upper Specification Limit) USL = 0.30 & Defect Density (Lower Specification Limit_ LSL = 0.05). Simillarly for 8 different Metrics. Why I need these Spec. Limits ?...Because I want o compare my project's Metrics Value displayed in the Grid View with the corresponding USL & LSL value of the same Metrics. IF Metrics Value is outside of USL & LSL Then I want to Mark the Metrics in Red Color.
1. STORED PROC "Get_Spec_Limits" Does Not Return Anything 2. Error : Object Reference Not set to an Instance of an Object, in the following "OnRowDataBound' Event
OnRowDataBound="GridView1_RowDataBound" Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles GridView1.RowDataBound Dim strConnection As String = "Data Source=******;Initial Catalog=Metrics;Integrated Security=True" Dim objConnection As New SqlConnection(strConnection) Dim da As New SqlDataAdapter("Get_Spec_Limits", objConnection) da.SelectCommand.CommandType = CommandType.StoredProcedure Dim Productivity_USL As New SqlParameter("@Productivity_LSL", SqlDbType.Float) Dim Productivity_LSL As New SqlParameter("@Productivity_LSL", SqlDbType.Float) Dim IDD_LSL As New SqlParameter("@IDD_LSL", SqlDbType.Float) Dim IDD_USL As New SqlParameter("@IDD_USL", SqlDbType.Float) Dim EDD_LSL As New SqlParameter("@EDD_LSL", SqlDbType.Float) Dim EDD_USL As New SqlParameter("@EDD_USL", SqlDbType.Float) Dim DRE_FS_LSL As New SqlParameter("@DRE_FS_LSL", SqlDbType.Float) Dim DRE_FS_USL As New SqlParameter("@DRE_FS_USL", SqlDbType.Float) Dim DRE_TS_LSL As New SqlParameter("@DRE_TS_LSL", SqlDbType.Float) Dim DRE_TS_USL As New SqlParameter("@DRE_TS_USL", SqlDbType.Float) Dim DRE_Code_USL As New SqlParameter("@DRE_Code_USL", SqlDbType.Float) Dim DRE_Code_LSL As New SqlParameter("@DRE_Code_LSL", SqlDbType.Float) Dim COQ_USL As New SqlParameter("@COQ_USL", SqlDbType.Float) Dim COQ_LSL As New SqlParameter("@COQ_LSL", SqlDbType.Float) Dim COPQ_USL As New SqlParameter("@COPQ_USL", SqlDbType.Float) Dim COPQ_LSL As New SqlParameter("@COPQ_LSL", SqlDbType.Float)......................
I am goig to execute an oracle store procedure using C# through through ODP.NET. The store procedure executes succsfully but it does not return any value in the out parameter.
When I execute the same store procedure with the same input parameteres from within SQL*Plus. It does return values.
This is to be clearify here that in the oracle store procedure the data type for the out parameter is number and in the c# the variavle that will hold its value is Integer. I also tried using Long on the C# side but it is still not working. After the successfull execution of the store procedure the C# variable contains nulll value.
I've a string builder, and I need to convert it to a string, and then trim any commas if there are any there (I need to get rid of them because I'm building an sql query).
Here's what I'm doing:
myStringBuilder.ToString().TrimEnd(',');
Why isn't this working??? It's not trimming any commas at the end!
using vb.net/asp.net 2005 and sql server 2005. I'm querying the database and returning text which I am then adding to a string. I'm creating a crystal report with the text however this is not a crystal report question, its about the string data. what I"m noticing is that when I show the string on the pdf that there are some strange characters at the end of the string. I am both trimming the string and taking out null characters however the strange text shows up like this:
strangeText> SÙÇ TÙçy|Ü DÙÇ $ÛÇ </strangeText>
does anyone know what these characters are and how to get rid of them?
The GridView in ASP.NET 2.0 is trimming the leading spaces from data coming from a SQLServer database. I have yet to find a way to keep it from doing that. The data in this particular view is being edited to remove such spaces, but only upon editing the row can any leading spaces be seen, meaning, at present, each row will have to be touched. With 12,000+ rows, that's a little much.
What little I've found on Google has mainly be concerned with trimming leading spaces. Is there a way to force GridView to show the data exactly as it is in the database, leading spaces and all?
We're writing an app that has a requirement for allowing/disallowing access based on user role.In a traditional .net app of course you set the security trimming attribute in the web.config and set the nodes in the web.sitemap file and you were set.
In my web.config I have configured a SiteMapProvider with securityTrimmingEnabled="true" and on my main master page is an asp:Menu control bound to an asp:SiteMapDataSource. In addition I have configured restricted access to all pages in a subfolder "Admin" (using another web.config in this subfolder).
... it seems that security trimming does not work: The menu item is visible for all users. (Access to the page is still restricted though, so selecting the menu item by non-Admin users does not navigate to the restricted page.)
Question: Is there any setting I've missed so far to make security trimming working with URL routing in ASP.NET 4.0 Web Forms? Did I do something wrong? Is there any work-around?
I have a string coming from a stored procedure looks like '001234567'.
sqlCommand = new SqlCommand("csp_Bbp_OBN_GetBasePageList", BBConnection); sqlCommand.CommandType = System.Data.CommandType.StoredProcedure; sqlCommand.Connection.Open(); // Run the SQL statement, and then get the returned rows to the DataReader. accReader = sqlCommand.ExecuteReader();............
In my case, from the stored procedure I am returning the varchar, after executing and reading it I am getting the value to basePage.GrouNum which is a string. So, I don't see where it is trimming the leading zeros.
Example: GroupNumber in the table is : "001234567" BasePage.GroupNum after reading from DataReader : "1234567"
But, I do not want the leading zeros being trimmed.
What function do I use to reduce all entries in a database field to a maximum length. The field is 100 characters wide and I need to chop all existing entries in the field down to 20 characters. I prefer not to redefine the field to 20 wide to lose the data and then redefine back to 100.
UPDATE CmpyInfo SET ( ShortName to 20 characters max ) WHERE ShortName.Length > 20
a) SqlCommand.ExecuteNonQuery is used for update, insert and delete operations.
Besides the fact that by using ExecuteNonQuery instead of ExecuteReader we automatically know there won't be any query results returned, are there some other benefits/reasons why ExecuteNonQuery should be used?
b) Similarly, if we want a database operation to return a single value, we should use ExecuteScalar instead of ExecuteNonquery ,where with the latter result would be returned via SqlParameter. Is there any particular reason why we should prefer ExecuteScalar over ExecuteNonQuery?
I've got a routine that's supposed to be capturing data from an XML to a DataTable (which works fine), and then using that data to insert into MS SQL. I have no problems with the Inserting of records (via a different routine) but am struggling to update existing records - I'm not even getting any errors, and I can verify that the data is being assigned to the parameters.
Here's what I've got.
Shared Sub Sold(ByVal FullPath As String) Dim SQLSold As String Dim SC As New SqlConnection(CS) SQLSold = "Update Properties SET Status = @Status, Price = @Price WHERE UniqueID = @UniqueID" Dim DT As New DataTable
I need to write a single web page that checks the status of an SQL job, and allows the user to execute a new job if the job has a specific status.
I have the job status checking code working but have a problem when it comes to the execution of the next job. The problem is because as soon as ExecutNonQuery is run my code goes straight to the next line leaving SQL to do its own thing - therefore my UpdateProgress never shows. How do I get the UpdateProgress control is be aware that my Job is still running??
I also have a method called ReturnJobDetailStatus which I imagine I could use by continually checking it with a combination of the UpdateProgress control and a timer control? If so I cannot visualise how to achieve this?