I built a very simple report which uses a query to define the options in the parameter€™s dropdown. I used that same dataset to define the default for that parameter (meaning that it will just pick the first row from the dataset and use that as the default). When I run the report watching a Profiler trace on the SQL database, it runs that query twice. (Presumably, that€™s once to fill the dropdown list and once to figure out the default.) That seems silly to me since it is the same query that is the same dataset in Reporting Services. Is there any way around this? My parameter bar is rendering twice as slowly as it should be.
I've tested against SSRS 2005 SP1 and the CTP of SP2.
I have one page, one connection, and three dropdowns. The connection looks like (as an example):<asp:SqlDataSource ID="DropDownConn" runat="server" ConnectionString="<%$ ConnectionStrings:aousConnectionString %>" SelectCommand="SELECT [Value], [Text] FROM [DropDown] WHERE (([Group] = @Group) AND ([Viewable] = @Viewable))"> <SelectParameters> <asp:Parameter Name="Group" Type="String" /> <asp:Parameter DefaultValue="True" Name="Viewable" Type="Boolean" /> </SelectParameters></asp:SqlDataSource> The DropDowns Look like this: <asp:DropDownList ID="DropDown1" runat="server"></asp:DropDownList><asp:DropDownList ID="DropDown2" runat="server"></asp:DropDownList><asp:DropDownList ID="DropDown3" runat="server"></asp:DropDownList>The C# Code I am trying is like this:DropDownConn.SelectParameters["Group"].Equals("DropDown1");DropDownConn.SelectParameters["Viewable"].Equals(true);DropDown1.DataSourceID = "DropDownConn";DropDown1.DataTextField = "Text";DropDown1.DataValueField = "Value";DropDown1.DataBind(); As an example. I can not get it done so that I don't have to create 3 dataconnections. Any help, PLEASE?
I have created a menu report listing available reports and am setting the Jump to settings of each text box in the list to take the user to the relevent report. But I am having a problem setting up drill down to reports with multivalued parameters.
What I want to happen when the user drills down is for the report to open up with no parameter values selected. This works for single value parameters where I have set Null as the default value. But I have not been able to figure out how to do this with MVPs. Does anybody know if this is possible?
As a workaround I have been using Jump to URL (rather than Jump to report), which has no problem opening the report without having to pass any values for the MPV. But I do not like using this as I use different DEV/UAT and PROD environments so would have to amend the URL for each environment.
Seems like this should be possible... Any idea?
Cheers, Mike
PS: I should add I can Jump to reports with MVP without specifying a parameter in development studio but not when the report is published.
Hi All, I have two tables.First is CAT_TABLE_LIST ;FIELD_NAME OPPOSITE_NAME TBL_NAMEHeight (mm) COL_1 TBL_13Cylinder volume (cm³) COL_5 TBL_13Torgue (daN.m) COL_7 TBL_13Cylinder weight(kg) COL_13 TBL_13Pump Type COL_9 TBL_13Fuel Consumption Col_22 TBL_22Color Col_41 TBL_09--------------------------------------------------------------------Second is TBL_13 (there are a few tables for each distict value for CAT_TABLE_LIST.TBL_NAME column );STOCK_CODE COL_1 COL_5 COL_7 COL_13 COL_9FC-25 12,5 5 15.000 45 DP 75FT-45 27 9 40.000 35 DP 101--------------------------------------------------------------------the CAT_TABLE_LIST.TBL_NAME holds relevant table name and CAT_TABLE_LIST.OPPOSITE_NAME holds columns names of that relavant table.The issue is, the columns of relevant tables dynamicly created. I mean if i insert new row to CAT_TABLE_LIST like that;INSERT INTO CAT_TABLE_LIST ('Size(USA)','Col_77','TBL_13')the new column will created for TBL_13 ;ALTER TABLE TBL_13 ADD Col_77 VARCHAR(200)And if i delete a row from CAT_TABLE_LIST, in the same transaction the column will droped from relevant table, as followsDELETE CAT_TABLE_LIST WHERE TBL_NAME ='TBL_13' AND OPPOSITE_NAME='Col_77'goALTER TABLE TBL_13 DROP COLUMN Col_77-------- Expected select query result is (for TBL_NAME = 'TBL_13' AND STOCK_CODE ='FC-25' ) .....STOCK_CODE OPPOSITE_NAME FIELD_NAME VALUEFC-25 COL_1 Height (mm) 12,5FC-25 COL_5 Cylinder volume (cm³) 5FC-25 COL_7 Torgue (daN.m) 15.000FC-25 COL_13 Cylinder weight(kg) 45FC-25 COL_9 Pump Type DP 75------------------------------------------------------------------------------How can i get this result ? Thanks in advance...
Now, I don't know if what I want to do is possible, but here goes. In the table I want to query, there is an "approval status" column, of type Int32. There are four approval levels, 1, 2, 3 and 4. What I want to set up is a query in the table adapter that can return all entries of one or more approval levels. In "raw" sql, I would do something like: SELECT * FROM facility_table WHERE (approved IN (1,2,3));What I want to do though, is to have the list of approval codes to be a parameter that I can pass to the table adapter query, so the where clause becomes "WHERE (approved IN (@approval))", and I pass a string with the list of approval codes. But the query designer doesn't want to cooperate with me, as it insists that "@approval" should be an int32.Any suggestions?
I am a beginner with Report Designer (and with Reporting Services). Following the tutorials 'Adding parameters to filter Reports ...' I tried using the @symbol to add a parameter to my query: where code = @code_value...I get the error: ORA -000936 missing expression (msorlib) Is there another syntax that I should use to define a parameter/variable in query for my oracle dataset?
I am trying to filter data on a report by using drop downs. I have been able to create the drop downs, however I can only get one to actually filter content. I need to allow users to select the group from drop down one, and then a different group from drop down 2 so the end result will only display informaiton that matches both drop downs.
Any suggestions will be appreciated. Below is the code if needed
<SqlVariable name="V_Queue" display="Queue :" type="dbselect" displaycolumn="display" datacolumn="group_name" default="%"> <SelectQuery mssql="true" oracle="false" db2="false"> <![CDATA[ SELECT group_name, group_name AS display FROM table_1 WHERE group_name like '%cat1%' UNION SELECT '%' AS group_name, 'All' AS display ]]> </SelectQuery> </SqlVariable> <SqlVariable name="Group" display="Group :" type="dbselect" displaycolumn="display" datacolumn="group_name" default="%"> <SelectQuery mssql="true" oracle="false" db2="false"> <![CDATA[ SELECT group_name, group_name AS display FROM table_1 WHERE group_name like '%group%' UNION SELECT '%' AS group_name, 'All' AS display ]]> </SelectQuery> </SqlVariable>
Hi: I have two drop downs bound to the same data source.. These dropdowns are automatically populated from a database. When I click the button I get some sort of strange query error. Not sure what I'm doing wrong here.
<%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.SQLClient" %> <script language="VB" runat="server"> Dim sOrderby as String Dim sDirection as String Dim MySQL As String Dim MySQL1 As String Dim sSubject As String Dim sCategory As String
Sub Page_Load(ByVal Source As Object, ByVal E As EventArgs)
If Not Page.IsPostBack Then Dim strConn As String = "server=GAALP-DT-UHABB2CFW;uid=sa;pwd=removed;database=NetG" Dim MySQL As String = "Select DISTINCT [Subject] from dbo_v_netG_courses" Dim MySQL1 As String = "Select DISTINCT [Category] from dbo_v_netG_courses" Dim MyConn As New SqlConnection(strConn) Dim objDR As SqlDataReader Dim Cmd As New SqlCommand(MySQL, MyConn) Dim Cmd1 As New SqlCommand(MySQL1, MyConn) MyConn.Open() objDR = Cmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection) ddl.DataSource = objDR ddl.DataValueField = "Subject" ddl.DataTextField = "Subject" ddl.DataBind() MyConn.Close() MyConn.Open()
MyConn.Close() ddl.Items.Insert(0, "-- Choose --") ddlDir.Items.Insert(0, "-- Choose --") End If 'ddl.Items.Insert(0, "-- Choose --") End Sub
' Sub Page_Change(ByVal sender As Object, ByVal e As DataGridPageChangedEventArgs) ' MyDataGrid.CurrentPageIndex = e.NewPageIndex ' BindData()
'Sub GridOne(ByVal Source As Object, ByVal E As EventArgs) ' MyDataGrid.CurrentPageIndex = 0 'End Sub
'Sub GetData(ByVal Source As Object, ByVal E As EventArgs) ' BindData() ' End Sub Sub BindData(ByVal Source As Object, ByVal E As EventArgs)
sSubject = ddlDir.SelectedItem.Text sCategory = ddlDir.SelectedItem.Value Dim strConn As String = "server=GAALP-DT-UHABB2CFW;uid=sa;pwd=removed;database=NetG" If sSubject = "" And sCategory = "" Then MySQL = "Select * from dbo_v_netG_courses"
Else ( THIS LINE IS GIVING ME THE ERROR) MySQL = "Select * from dbo_v_netG_courses where [Subject] = & sSubject" End If Dim MyConn As New SqlConnection(strConn) Dim ds As DataSet = New DataSet() Dim Cmd As New SqlDataAdapter(MySQL, MyConn) Cmd.Fill(ds, "dbo_v_netG_courses") MyDataGrid.DataSource = ds.Tables("dbo_v_netG_courses").DefaultView MyDataGrid.DataBind() End Sub
just a simple question here: i have some input parameters on my report that are datetimes (i.e. the user gets the date picker to select the date), if i want to use that parameter in a MDX statement what will it look like? IOW would today's date look like the string "13/02/07", or would i be expecting a string like this: "2007/02/13 00:00"?
I am looking to convert some dropdowns that contain dates extracted from a cube heirarchy with the datepickers so i need to know what i have to change in the MDX to accomodate this.
I also filter the dates that appear in the current dropdowns, is there a way to do this with the datepickers (maybe by pointing them to a dataset of dates extracted from the cube)?
I’m using a SQLDataSource to populate a dropdown. The SQL table I use to populate the drop down has two columns. I only want one of them to be displayed in the drop down but I need to make decisions later in the code based on both columns. How do I access that second column in the datasource?
Hi All, I have literally spent the last 2 1/2 hours troubleshooting an issue where I pass a parameter to the page and based on the parameter it runs a SQL statement and fills in the fields on the form. It is giving me the error message below but I know its not a NULL value and I know those controls are named correctly. System.NullReferenceException: Object reference not set to an instance of an object.All of my textboxes and labels that are being populated are working fine when I comment out the dropdowns, I have this working on other pages but the only thing that is different here is I am using some AJAX (Autocomplete, Collapsable Panel and Calendar Control). If I add a label or a textbox field on the form and take the same value that is going to populate the dropdownlist and populate the new control it works, so i know I'm getting the data and its not null/nothing. I also verified that the parameter is working correctly. Any help will be a blessing, its probably something write under my nose!Thanks in advance!Tim Here is the codeDim conn As SqlConnectionDim comm As SqlCommandDim reader As SqlDataReaderDim connectionstring As String = ConfigurationManager.ConnectionStrings("MagicDEV").ConnectionStringDim SeqIncident As Integer = Convert.ToInt16(Request.QueryString("NAME")) If SeqIncident > 0 Thenconn = New SqlConnection(connectionstring)comm = New SqlCommand("Select isnull(t.[Sequence],'') as SeqIncident, " & _"isnull(t.Client,'') as SeqClient, " & _"isnull(c.Client,'') as Client, " & _"isnull(t.[Open By],'') as SeqOpenBy, " & _"isnull(p.[Code],'') as OpenedBy, " & _"isnull(t.[Sent To],'') as SeqAssignedTo, " & _"isnull(p1.code,'') as AssignedTo, " & _"isnull(t.[Date Open],'') as DateOpen, " & _"isnull(t.[Closed On],''), " & _"isnull(t.[Closed By],'') as SeqClosedBy, " & _"isnull(p2.[Code],'') as ClosedBy, " & _"isnull(t.[Seq_Severity:],'') as SeqUrgency, " & _"isnull(s.[Name],'') as Urgency, " & _"isnull(t.[Seq_UdStatus:],'') as SeqStatus, " & _"isnull(u.[id],'') as Status, " & _"isnull(t.Contact_Type,'') as ContactType, " & _"isnull(t.Ctrpart,'') as SeqAsset, " & _"isnull(i.[Asset#],'') as Asset, " & _"isnull(t.seq_rpt_party,'') as SeqRptParty, " & _"isnull(c1.client,'') as RptParty, " & _"isnull(t.Whiteboard_ID,'') as SeqWhiteboard, " & _"isnull(w.Whiteboard_ID,'') as Whiteboard, " & _"isnull(t.Subject,'') as SeqSubject, " & _"isnull(s1.[Description],'') as Subject, " & _"isnull(t.[Description],'') as IncDescription, " & _"isnull(t.Resolution,'') as IncResolution, " & _"isnull(t.[FCR:],'') as FCC, " & _"isnull(t.Sent_Ack,'') as SentAck, " & _"isnull(t.Inc_Closed,'') as IncClosed, " & _"isnull(t.RC,'') as RC " & _ "From _Smdba_._Telmaste_ t " & _"inner join _Smdba_._Customer_ c on t.client = c.[Sequence] " & _ "left outer join _Smdba_._Personnel_ p on t.[open by] = p.[Sequence] " & _"left outer join _Smdba_._Personnel_ p1 on t.[Sent To] = p1.[Sequence] " & _ "left outer join _Smdba_._Personnel_ p2 on t.[Closed By] = p2.[Sequence] " & _"left outer join _Smdba_._Severity_ s on t.[Seq_Severity:] = s.[Sequence] " & _ "left outer join _Smdba_._UdStatus_ u on t.[Seq_UdStatus:] = u.[Sequence] " & _"left outer join _Smdba_._Inventor_ i on t.[Ctrpart] = i.[Sequence] " & _ "left outer join _Smdba_._Customer_ c1 on t.seq_rpt_party = c1.[Sequence] " & _"left outer join _Smdba_._Whiteboard_ w on t.Whiteboard_ID = w.[Sequence] " & _ "left outer join _Smdba_._Subjects_ s1 on t.Subject = s1.[Sequence] " & _"Where t.Sequence = @Sequence1", conn) comm.Parameters.Add("@Sequence1", Data.SqlDbType.Int) comm.Parameters.Item("@Sequence1").Value = SeqIncident Try conn.Open() reader = comm.ExecuteReader() reader.Read()ClientDropDown.SelectedItem.Text = reader.Item("Client") ClientDropDown.SelectedItem.Value = reader.Item("seqclient") Finallyconn.Close()End TryEnd If
Hi,I have a table with uniqueidentifier column as its primary key. If I insert a record into this table by defining the key of this record in VB code (Dim myId As Guid = Guid.NewGuid ... is it??), is it possible that I receive the primary key violation error since the new record has an id which is already exists in the table? Thanks in advance
if in response to an alert i have defined a job and this job is scheduled for 10.00 am daily, will this job execute daily or only in response to the alert? also i have set notifications to my computer in alert as well as in job. buti get notification defined in job and not in alert. why is it so?
I have this 3 tables, Customer, Transaction and Book. Since a customer can buy the same book more than one time, I've defined Transaction_Nr as primary key of Transaction and put Customer_Nr and Book_Nr as foreign keys. So the layout is more or less like this :
So now my question is, would it have been better, to define Transaction_Nr, Book_Nr and Customer_Nr as a combined primary key or to leave Transaction_Nr alone ? What would be the difference ?
I'm trying to populate a DropDownList from my SQL database. I'm using C# 2005 and when I compile my code I get an error. Compiler Error Message: CS0103: The name 'myConnection' does not exist in the current context using System; using System.Data; using System.Data.SqlClient; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class Default3 : System.Web.UI.Page { private string connectionString = WebConfigurationManager.ConnectionStrings["mewconsultingConnectionString"].ConnectionString;
protected void Page_Load(object sender, EventArgs e) { SqlCommand myCommand = new SqlCommand(); myCommand.Connection = myConnection; myCommand.CommandText = "SELECT * FROM tblPau"; myConnection.Open(); SqlDataReader myReader; myReader = myCommand.ExecuteReader(); myReader.Read(); // The first row in the result set is now available. lstPau.Items.Add(myReader["PauSiteName"]); myReader.Close(); myConnection.Close(); } }
I create my datasource to point to my local asmx and tested it by going directly to the URL which worked. I then create a dataset in my report which points to this datasource and has this as the query string:
Is there any harm in defining a SqlConnection as a private class variable for a web page?Private SqlConnection cn = new SqlConnectection(ConfigurationManager.ConnectionStrings["MyString"].ConectionString);The connection is only opened in certain event handlers, and is closed right after use. It was always my understanding that creating the connection is not a big deal but opening the connection is. Is that correct?
Can anyone help me understand what it takes to define a Linked Serverconnection to an IBM eSeries (AS400)? Do I need Microsoft's SNA Serveror some other product or can I simply do it with the tools provided withSQL Server 2000?Any guidance would be very appreciated. Thanks.Farid
I am new to SQL Server platform, i want to define primary keys automatically other than using an identity. For a table called indicator i want it primary keys to be like ind_001, ind_002, ind_003 and so on.
Can anybody help me on how to do this? I am new to this platform so i will appreciate it if suggestions are explained very clearly. Thank you
I have same table structures in two database and one master table which contains Table id, Table name,primary key, data type of primary key. i have to comapare Tables in both tha database and as per result i have to do insert,update or delete.
for that i have written query :
DECLARE @rowcount_mastertable FLOAT SET @rowcount_mastertable = (select count(*) from master_table)
SET @TABLE_NAME = (SELECT TABLE_NAME FROM MASTER_TABLE TABLE_ID = @COUNTER) SET @primary_key = (SELECT primary_key FROM MASTER_TABLE WHERE TABLE_ID = @COUNTER) SET @Primarykey_DATATYPE = (SELECT Primarykey_DATATYPE FROM MASTER_TABL WHERE TABLE_ID = @COUNTER)
--In below line i want to declare a variable and datatype should be same as what we got from master table so that i can use this @MAX_primary_key to fetch --max of primary key from table name where table id is 1 DECLARE @MAX_primary_key @Primarykey_DATATYPE SELECT @MAX_primary_key = MAX(@primary_key) FROM @TABLE_NAME WHERE TABLE_ID = @COUNTER
---But by running it i am getting error that "Incorrect syntax near '@Primarykey_DATATYPE'. and "Must declare the variable '@MAX_primary_key'.
I am pretty new to SQL Server 2005 and SSIS. I am trying to dynamically load files into SQL Server 2005 using files/paths contained in tables. I have a key table in my SSIS package that defines which files should be processed, some default values that will be associated with each file (ie CompanyKey and PeriodKey) and the file path (see below for example):
CompanyKey
PeriodKey
ProcessFlag
FileName
2
61
FALSE
2005TB200501.xls
2
62
FALSE
2005TB200502.xls
2
63
FALSE
2005TB200503.xls
2
64
TRUE
2005TB200504.xls
2
65
TRUE
2005TB200505.xls
2
66
TRUE
2005TB200506.xls
2
67
TRUE
2005TB200507.xls
2
68
TRUE
2005TB200508.xls
2
69
TRUE
2005TB200509.xls
2
70
TRUE
2005TB200510.xls
2
71
TRUE
2005TB200511.xls
2
72
TRUE
2005TB200512.xls
The package I am developing is supposed to loop through this table checking for files with ProcessFlag = TRUE. For those files, it will load all of the records/columns (prefaced with the company and period keys) into a common table.
Do I have to manually create data sources for each file or is there a way to dynamically define the connection and process the connection?
Any assitance you could provide would be greatly appreciated!
I'm assisting in the creation of a development enviroment with SQL Server 2005, and I need to assign some custom roles, in particular, a Stored Developer Role should be able to create, modify and execute Stored Procedures but they should not be able to alter tables or views, but should be able to retrieve/insert data from those tables.
I've tried with the default roles in 2005 to no avail.
Is there a relatively easy way to accomplish this with a database alredy populated with objects of both kinds? (SP's and Tables / Views)
Can someone verify that an assembly containing an interface with an event definition, such as...
public interface A { event EventHandler Foo; }
... can never be loaded under SAFE or EXTERNAL_ACCESS ?
It appears that the compiler-generated add_xxx and remove_xxx have the MethodImpl(MethodImplOptions.Synchronized) attribute defined by default, and "Explicit synchronization is not allowed". The same limitation also applies to classes by default, although technically one is able to define the implementation directly (clearly not ideal).
Hiii I am working on a application where I will upload my excel sheet.Then the application will read the header and will create a table to store the excel sheet. When the excel sheet will be uploaded first it will read the header of the excel and will display it inside a gridview to choose which columns are to be created along with datatype.I am giving u a snapshot
Column Name Select Datatype
Group Code
Emp No
Mem code
Amount
So Here the user is selecting tha data type.So I am passing the data type to my functions.But while assigning the datatype I am getting error that can no convert from sting to Microsoft.SqlServer.Management.Smo.DataType.I am giving u the demo codeprivate void button1_Click(object sender, EventArgs e) {ServerConnection objsvrconn = new ServerConnection(); objsvrconn.LoginSecure = false;objsvrconn.ServerInstance = "DEMO"; objsvrconn.Login = "sa";objsvrconn.Password = "sa"; Server objsvr;objsvr = new Server(objsvrconn); //objsvr.ConnectionContext.Connect();Table tb = objsvr.Databases["Demo"].Tables["Temp"]; Column c = new Column(tb, "GrpCode"); DataType dt = new DataType();dt.SqlDataType =(DataType)"Varchar" ---I am getting the error here.It only accecept from a enum i.e Datatype.Typename but doesnot accept like this dt.MaximumLength = 10; c.DataType = dt; tb.Columns.Add(c); tb.Alter(); }
I have an XML file that some of the nodes are represented with a namespace prefix. I have found the "msdn" page where shows the possibility to filter using the Namespace Prefix, but I have not been successful at it.
On first Node A: The server has 16 GB of physical RAM. On second Node B: The server has 10 GB of physical RAM.
Now, this being Active Active, Node A can be clustered on failure onto Node B..Now reporting server is configured under these two nodes, with defined MAX and MIN server memory of 12 as MAX and 0 is min IN GB.Now with this setting on SQL whenever the cluster moves, such config make OS goes low on node for 10 GB.I am only left with option of switching this MAX and MIN to a default setting or is there any other alternative such as script which can change this setting accordingly when cluster moves to respective server.
I'm using SQL 2008 Februar CTP and trying to use SSIS for Data Source as described in http://msdn2.microsoft.com/en-us/library/ms159215(SQL.100).aspx. I've created SSIS package and preformed steps described in http://msdn2.microsoft.com/en-us/library/ms345250(SQL.100).aspx (after fixing version to 10.0.0.0).
Now I got next error when trying to add SSIS DataSource (in Report Designer - Visual Studio):
Error messageThe data extension SSIS could not be loaded.
i am using visual web developer 2005 and SQL 2005 with VB as the code behindi am using INSERT command like this Dim test As New SqlDataSource() test.ConnectionString = ConfigurationManager.ConnectionStrings("DatabaseConnectionString1").ToString() test.InsertCommandType = SqlDataSourceCommandType.Text test.InsertCommand = "INSERT INTO try (roll,name, age, email) VALUES (@roll,@name, @age, @email) " test.InsertParameters.Add("roll", TextBox1.Text) test.InsertParameters.Add("name", TextBox2.Text) test.InsertParameters.Add("age", TextBox3.Text) test.InsertParameters.Add("email", TextBox4.Text) test.Insert() i am using UPDATE command like this Dim test As New SqlDataSource() test.ConnectionString = ConfigurationManager.ConnectionStrings("DatabaseConnectionString").ToString() test.UpdateCommandType = SqlDataSourceCommandType.Text test.UpdateCommand = "UPDATE try SET name = '" + myname + "' , age = '" + myage + "' , email = '" + myemail + "' WHERE roll 123 " test.Update()but i have to use the SELECT command like this which is completely different from INSERT and UPDATE commands Dim tblData As New Data.DataTable() Dim conn As New Data.SqlClient.SqlConnection("Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|Database.mdf;Integrated Security=True;User Instance=True") Dim Command As New Data.SqlClient.SqlCommand("SELECT * FROM try WHERE age = '100' ", conn) Dim da As New Data.SqlClient.SqlDataAdapter(Command) da.Fill(tblData) conn.Close() TextBox4.Text = tblData.Rows(1).Item("name").ToString() TextBox5.Text = tblData.Rows(1).Item("age").ToString() TextBox6.Text = tblData.Rows(1).Item("email").ToString() for INSERT and UPDATE commands defining the command,commandtype and connectionstring is samebut for the SELECT command it is completely different. why ?can i define the command,commandtype and connectionstring for SELECT command similar to INSERT and UPDATE ?if its possible how to do ?please help me
I have to create a stored procedure where the criteria is: "All", specific value and, all except one value so far this is what I have:@Status varchar (50) -- as parameter from a dropdown boxDECLARE @NewStatus varchar(50) SET @NewStatus = CASE WHEN @Status ='All' AND @Status <> 'All but closed' THEN '%' WHEN @Status <>'All' AND @Status <> 'All but closed' THEN @Status END
and in the stored procedure
.........
WHERE Status like @NewStatus I am a little confused as to how could I return all values except those that have the value "Closed" Thanks.