Error When I Pass Parmeter Using Querystring?
Mar 20, 2008
hi all
this my data source
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:PhoneBook %>"
SelectCommand="SELECT personid,firstname,lastname,birthadate FROM [Persons] WHERE (([BirthDate] >= @BirthDate) AND ([BirthDate] <= @BirthDate2))">
<SelectParameters>
<asp:QueryStringParameter Name="BirthDate" QueryStringField="InitialDate" Type="DateTime" />
<asp:QueryStringParameter Name="BirthDate2" QueryStringField="LastDate" Type="DateTime" />
</SelectParameters>
</asp:SqlDataSource>
i pass parmater from button Search and his code as followingprotected void btnSD_Click(object sender, EventArgs e)
{DateTime x =DateTime .Parse (txtIDate.Text);
DateTime y = DateTime.Parse(txtLdate.Text);Response.Redirect("~/Search/SearchResultDate.aspx?InitialDate>=" + x + "&" + "LastDate<=" + y);
}
as you see i write two date in txtbox and then click on search button i get Error
System.FormatException was unhandled by user code
Message="String was not recognized as a valid DateTime."
Source="mscorlib"
StackTrace:
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at System.DateTime.Parse(String s)
at SearchWUC.btnSD_Click(Object sender, EventArgs e) in c:WebSitesAdAdo.netPhoneBookDevSearchWUC.ascx.cs:line 53
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
plz how i solve this
thanxs all
View 4 Replies
ADVERTISEMENT
Jan 10, 2007
I am working in SSRS 2005. I have three parameters on the reports
Parmeter 1 is Date filter which is drop down and values are MTD,QTD,YTD...
2nd and 3rd parameters are fromdate and todate which are datetime parameters.
When user select let's say MTD from parameter1 then i have Stored procedure which populate the fromdate paramter with 1st date of the month and, todate populate the todays's date. The problem i am facing is the moment these date parameters get populated it converts into drop down. i want these date parameters should be still datetime so user can select the date. The value i am passing to these parameters are datetime type( Now()) .Still the date parameters controls are showing as dropdown. I don't know how to handle it. Please help me if you have faced this kind of problem.
Thanks,
Ranjay
View 6 Replies
View Related
Dec 22, 2006
I cant seem to make this sql work.....
SELECT UserId, UserFirstName, UserLastName, UserPhone, UserName, UserEmail FROM UserTable WHERE (@SearchCat = @SearchText)
This works fine (Where UserName = @SearchText)
I need the "UserName" field to beable to be; UserID, UserPhone, Etc, not all at once just based on a list box My trouble lies in the @SearchCat...
I need to be able to choose which column im searching in. I have 1 list box with coulmn names in it and a text box that holds the text that is being searched for. Any help would be awsome... Thanks Neil
View 3 Replies
View Related
Jan 27, 2008
I have a stored procedure that has the following:
DECLARE @cnt int
DECLARE @cnt_sql varchar(1000)
SET @cnt_sql = 'SELECT COUNT(*) FROM table WHERE something = this'
-- @that is a passed parameter
if @that != ''
BEGIN
@cnt_sql = @cnt_sql + 'AND some_field = some_value'
I then want to be able take the result from @cnt_sql and set it to @cnt... but for the life of me I can't seem to think of the right way to do this?
Any tips are appreciated
View 1 Replies
View Related
May 18, 2007
Hi,I wrote two queries to search in three tables mp_parent, mp_page and mp_parentThe first one is: SELECT mp_page.PID, mp_page.PageID, mp_page.PageContent, mp_page.ParID, mp_page.ChiID, mp_parent.ParentName FROM mp_page INNER JOIN mp_parent ON mp_page.ParID = mp_parent.ParentID The second one is:SELECT mp_page.PID, mp_page.PageID, mp_page.PageContent, mp_page.ParID, mp_page.ChiID, mp_child.ChildName FROM mp_page INNER JOIN mp_child ON mp_page.ChiID = mp_child.ChildID I used this way to display the records in a FormView public HttpContext context = HttpContext.Current; public void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ViewState["srch"] = context.Items["srch"]; } FormView1.DataSource = GetTable(); FormView1.DataBind(); } private DataTable GetTable() { SqlConnection SqlCon = new SqlConnection("Data Source=AJ-166DCCD87;Initial Catalog=mp;Integrated Security=True;Pooling=False"); String SQL1 = "select mp_page.PID, mp_page.PageID, mp_page.PageContent, mp_page.ParID, mp_page.ChiID, mp_parent.ParentID, mp_parent.ParentName from mp_page INNER JOIN mp_parent ON mp_page.ParID = mp_parent.ParentID where PageContent like '%" + Convert.ToString(ViewState["srch"]) + "%'"; SqlDataAdapter Adptr = new SqlDataAdapter(SQL1, SqlCon); SqlCommandBuilder CB = new SqlCommandBuilder(Adptr); DataTable Dt = new DataTable(); Adptr.Fill(Dt); return Dt; SqlCon.Close(); } the question is how can I check if one record is empty to witch to another query ??Is it possible to know without using QueryString?Thank you
View 5 Replies
View Related
Apr 12, 2007
I have 2 pages. ( i want to pass information from a text box to the "certificate.aspx" database query)
page 1 certsearch.aspx
this is my script i have a label, commnad button, & textbox
If txtSearchCert.Text = "" Then
lblMsg.Text = "Please enter a certificate #"
Else
Response.Redirect("certificate.aspx" & txtSearchCert.Text)
End If
page 2 certificate.aspx
i am not sure what goes here.this is what i am trying
Request.QueryString = (txtSearchCert.text)
This is my database query on certificate.aspx page
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:imacsConn %>"
SelectCommand="SELECT * FROM [SummaryBlue] WHERE REPORTNUMBER = ?"></asp:SqlDataSource>
View 3 Replies
View Related
Jan 28, 2008
I have a column name URL in Table1 with data like <a href="/Folder1/view_media_news.cfm?news_media_i=1">August 2002 Factsheet</a> <a href="/Folder1/view_media_news.cfm?news_media_i=149">March 2002 Newsletter </a> i need to grab the news_media_i value by sql query Please any one can help me to get that particular value from string using substring or any other suggestion Thank you in advance
View 4 Replies
View Related
Feb 1, 2008
Hi, I'm having problems passing a querystring from the datanavigateurlformatstring to be used in a insert sp on a webform. Please can someone take a look at my code and point me in the right direction. At the moment I'm gettingthis error messageCompiler Error Message: BC30451: Name 'userid' is not declared. but in the url i can see the querystring I've passed from the previous page.
Thanks in advance Dave
1 Protected Sub Execute_Clicked(ByVal sender As Object, ByVal e As EventArgs)
2
3 Dim objConn As New System.Data.SqlClient.SqlConnection()
4 objConn.ConnectionString = "My connection string"
5 objConn.Open()
6 Dim objCmd As New System.Data.SqlClient.SqlCommand("test_insert", objConn)
7 objCmd.CommandType = System.Data.CommandType.StoredProcedure
8
9
10 Dim puserid As System.Data.SqlClient.SqlParameter = objCmd.Parameters.Add("@userid", System.Data.SqlDbType.Int)
11 Dim pdate As System.Data.SqlClient.SqlParameter = objCmd.Parameters.Add("@date", System.Data.SqlDbType.DateTime)
12 Dim papplicants As System.Data.SqlClient.SqlParameter = objCmd.Parameters.Add("@applicants", System.Data.SqlDbType.Int)
13 Dim pclients As System.Data.SqlClient.SqlParameter = objCmd.Parameters.Add("@clients", System.Data.SqlDbType.Int)
14 Dim pcontacts As System.Data.SqlClient.SqlParameter = objCmd.Parameters.Add("@contacts", System.Data.SqlDbType.Int)
15
16
17
18
19
20 puserid.Direction = System.Data.ParameterDirection.Input
21 puserid.Value = Convert.ToInt32(userid.QueryString)
22 pdate.Direction = System.Data.ParameterDirection.Input
23 pdate.Value = Convert.ToDateTime([date].Text)
24 papplicants.Direction = System.Data.ParameterDirection.Input
25 papplicants.Value = Convert.ToInt16(applicants.Text)
26 pclients.Direction = System.Data.ParameterDirection.Input
27 pclients.Value = Convert.ToInt16(clients.Text)
28 pcontacts.Direction = System.Data.ParameterDirection.Input
29 pcontacts.Value = Convert.ToInt16(contacts.Text)
30
31
32
33 command.ExecuteNonQuery()
34
35
36 objConn.Close()
37
38 End Sub
View 7 Replies
View Related
Mar 8, 2008
Hi, I'm using the following to send two items in the querystring over to the next page, where I can display tables based on them. Both querystrings appear fine in the URL. The first querystring works fine to single out the order specified by the orderid from the querystring, but I can't seem to get my other sqldatasource to show the userid (+contents of aspnet_users table) using the userid I passed in the querystring. <asp:HyperLinkField DataNavigateUrlFields="OrderID,UserId" DataNavigateUrlFormatString="Copy of Orders.aspx?OrderID={0}&UserId={1}" DataTextField="OrderID, UserId" /> This is what I'm using to try and pick up the userid <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource3" DataKeyNames="UserId"> <Columns> <asp:BoundField DataField="UserId" HeaderText="UserId" SortExpression="UserId" /> <asp:BoundField DataField="UserName" HeaderText="UserName" SortExpression="UserName" /> </Columns> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString2 %>" SelectCommand="SELECT [UserId], [UserName] FROM [aspnet_Users] WHERE UserId = @UserId"> <SelectParameters> <asp:QueryStringParameter DefaultValue="UserId" Name="UserId" QueryStringField="UserId" Type="object" /> </SelectParameters> </asp:SqlDataSource>
View 1 Replies
View Related
Apr 19, 2008
Halloi have a problem to send a parameter via QueryString to my storedProcedure.If i run the procedure in VisualWebDeveloper everything works fine, when i enter the parameter with the DialogBox: 1 ALTER PROCEDURE dbo.StoredProcedure2 2 @appart varchar(50)3 4 AS5 BEGIN6 7 SELECT category FROM immovables WHERE category = @appart 8 END9 /* SET NOCOUNT ON */ 10 RETURNThen i have a simple Page with a link <a href="Test.aspx?objtxt=34" target="_self">send</a> that send the QueryString to the Following Site: <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Unbenannte Seite" %><asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="StoredProcedure2" SelectCommandType="StoredProcedure" SortParameterName="objtxt"> <SelectParameters> <asp:QueryStringParameter Name="appart" QueryStringField="objtxt" Type="String" /> </SelectParameters> </asp:SqlDataSource> <asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="125px" AutoGenerateRows="False" DataSourceID="SqlDataSource1"> <Fields> <asp:BoundField DataField="category" HeaderText="category" SortExpression="category" /> </Fields> </asp:DetailsView> </asp:Content> Now, when i run the application, i get the following message, when i fire up the Link:Für die Prozedur oder Funktion StoredProcedure2 wurden zu viele Argumente angegeben.I'm german so i get this message in german, tranlated: to many aguments wher passed to the procedure or funktion StoredProcedure2 I think the problem has thomething to do with the parameter deklaration in the storedProcedure.am I wrong?can somebody help me?Regards from Cologne (Germany) Caspar
View 5 Replies
View Related
Dec 17, 2004
If I script the SQL statement with a constant, deleting the record from the database works.
If I script the SQL statement to delete based on the WHERE clause being a variable name, it will not delete the record.
The value being compared in the WHERE clause comes directly from the Sequel database.
I have a dropdown box that is filled from the database. The dropdown1.selecteditem.text is placed in a variable. The script is to delete a record from the database where the table.name in the database equals the item name selected from the dropdown box.
This querystring does not delete the record from the database:
dim queryString As String = "DELETE FROM [Table1] WHERE ([Table1].[name] = 'variableCompareText')"
This querystring does delete the recrod from the database:
dim queryString As String = "DELETE FROM [Table1] WHERE ([Table1].[name] = 'John')"
Why can't I delete a record with a variable in the querystring? Otherwise, you would have to always know in advance which record to specify rather than being deleted dynamically.
View 2 Replies
View Related
Apr 4, 2008
I have a report that has 2 parameters. I use this report to do comparisons of performance data between two builds of our product. I'm not hosting this report in a seperate page, just using the standard sql reporting services web interface.
I'd like to be able to send out a link to this page that will load up the page with values for the parameters specified. I know in the report definition itself I can change the default parameter values, but I'd rather not change and redeploy the report every time I need to send it out for others to view.
My first thought was that it should be easy enough to specify the parameters as part of the url querystring and read the values in somehow using an expression for the parameters default value. Is this possible? I've done a bunch of searching but can't seem to find any good examples of this.
View 3 Replies
View Related
Feb 2, 2008
Hi i am trying to insert the value of my Request.Querystring into my stored procedure, but i am having trouble with it, how would i insert the id as a parameter which is expected from the stored procedure this is what i have doen so far;string strID = Request.QueryString["id"];
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["streamConnectionString"].ConnectionString);SqlCommand comm = new SqlCommand("stream_PersonnelDetails", conn);comm.CommandType = CommandType.StoredProcedure;
conn.Open();SqlDataReader reader = comm.ExecuteReader(CommandBehavior.CloseConnection);
DataList1.DataSource = reader;
DataList1.DataBind();
conn.Close();
Thank you
View 2 Replies
View Related
Feb 29, 2008
I am working on a form that when text is entered, the action Page is to execute the following query:
SELECT PhList.Name AS Employee, PhList.Phone, Department.Name, PhList.JobTitle FROM PhList INNER JOIN Department ON PhList.Department = Department.ID WHERE (PhList.Name LIKE @Search) OR (PhList.Phone LIKE @Search) OR (Department.Name LIKE @Search)"
BUT... i am having trouble making my @Search Parameter = %value% (where only 'value' was typed into the original form)
Here is my SQLDataSourceCode...<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Intranet %>"
SelectCommand="SELECT PhList.Name AS Employee, PhList.Phone, Department.Name, PhList.JobTitle FROM PhList INNER JOIN Department ON PhList.Department = Department.ID WHERE (PhList.Name LIKE @Search) OR (PhList.Phone LIKE @Search) OR (Department.Name LIKE @Search)"
OnSelecting="SqlDataSource1_Selecting">
<SelectParameters>
<asp:QueryStringParameter Name="Search" QueryStringField="Search" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
here is my Selecting code... Protected Sub SqlDataSource1_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs) e.Command.Parameters("Search").Value = "%" & Request.QueryString("Search") & "%" End Sub
The error i am getting is...
An SqlParameter with ParameterName 'Search' is not contained by this SqlParameterCollection. (From the e.command.par.........)
View 2 Replies
View Related
Feb 18, 2006
hi. i'm building a news section for some friends of mine. i list all the news items on the main page in a gridview. i've made a custom edit linkbutton that sends the user to an edit page, passing the news id as a quarystring variable. on the edit page i first check if the querystring variable contains an id at all. if not, i redirect the user to the main page. if an id is passed with the querystring, i fetch the matching news item from the database and place it in a formview control for editing.so far, so good. but what if someone types a random id in the querystring? then the formview won't show up and i'd look like a fool. :) therefore, i need some kind of check to see if the id exists in the database. if not redirect the user back to the main page... so i started thinking: i could check the databsae in a page_load procedure. if all is well, then display the news item. since the formview is automatically filled with the correct data, does that mean that i call the database two times? i mean, one for checking if the news item exists, and one for filling the formview. logically, this would be a waste of resources.help is appreciated.
View 3 Replies
View Related
Apr 13, 2006
I want to insert values from the querystring but nothing happens with this code (the sp works great from the Query Analyzer):
<form id="form1" runat="server">
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"InsertCommand="spSearch_row_insert" InsertCommandType="StoredProcedure">
<InsertParameters>
<asp:QueryStringParameter Name="CustomerID" QueryStringField="1" DefaultValue="1" Type="String" />
<asp:QueryStringParameter Name="SearchID" QueryStringField="2" DefaultValue="1" Type="String"/>
<asp:QueryStringParameter Name="SearchDate" QueryStringField="3" DefaultValue="1" Type="String" />
<asp:QueryStringParameter Name="IP" QueryStringField="4" DefaultValue="1" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
</form>
I'm very grateful for help!// G
View 3 Replies
View Related
Aug 10, 2007
Hi,
I am trying to import transfer data from one database(sqlserver) to another database(sqlserver)...
But when i run the stored procedure... it gives me the following error
Msg 2627, Level 14, State 1, Procedure usp_ImportFunds_Growthof10K, Line 36
Violation of PRIMARY KEY constraint 'PK_Growthof10K'. Cannot insert duplicate key in object 'Growthof10K'.
and this is my sproc
Code Snippet
USE [StageFiserv_Dev]
GO
/****** Object: StoredProcedure [dbo].[usp_ImportFunds_Growthof10K] Script Date: 08/10/2007 12:53:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Procedure [dbo].[usp_ImportFunds_Growthof10K]
AS
BEGIN
DECLARE @Count int
SET NOCOUNT ON;
UPDATE Fiserv_Dev..Growthof10K
SET
ChartHeader = g.ChartHeader,
Dates = Substring(g.Dates,1,9),
NAV = g.NAV,
LastChangeDate = GetDate()
FROM
Fiserv_Dev..Growthof10K gk
Join [Growth] g ON gk.Cusip = g.Cusip
Where
gk.ChartHeader <> g.ChartHeader
OR
gk.Dates <> Substring(g.Dates,1,9)
OR
gk.NAV <> g.NAV
SET @Count = @@ROWCOUNT
IF @Count > 0
RAISERROR('Updated %d records(s) in Growthof10K.', 0, 1, @Count) WITH NOWAIT
ELSE
RAISERROR('No changes made Growthof10K.', 0, 1) WITH NOWAIT
RAISERROR('Adding records to Growthof10K.',0,1) With NOWAIT
INSERT INTO Fiserv_Dev..Growthof10K
(
Cusip,
ChartHeader,
Dates,
NAV
)
SELECT
g.Cusip,
g.ChartHeader,
Substring(g.Dates,1,9),
g.NAV
FROM
Growth g
Where
NOT Exists (
Select *
FROM
Fiserv_Dev..Growthof10K gk
Where
gk.Cusip = g.Cusip
)
SET @Count = @@ROWCOUNT
IF @Count > 0
RAISERROR('Added %d records(s) to Growthof10K table.', 0, 1, @Count) WITH NOWAIT
ELSE
RAISERROR('No records added to Growthof10K table.', 0, 1) WITH NOWAIT
SET NOCOUNT OFF
END
There around 763 records in the growth table
Can some one please help me.
Regards,
Karen
Karen
View 4 Replies
View Related
Aug 14, 2007
I pass in 3 querystring parameters to my web form. The Object Data Sources pick up these parameters
and select the appropriate records.
I want to display one of the querystring parameters in my Page Header, specifically the one for Fiscal Year.
I could return the Fiscal Year in a column from the data source, but the Fiscal Year would not populate if
no records were returned...Therefore, I must get the querystring parameter that was originally passed in...
How do I populate the report control textbox with the value of querystring parameter?
Thanks!
Jim
View 14 Replies
View Related
Jan 29, 2014
I have a scenario in which if I do bulk insertion in a table and if any error occurs then insertion should not stopped and will proceed with insertion of remaining records.
View 2 Replies
View Related
Aug 29, 2007
I am trying to pass back the number of errors encountered by a child package to the Parent package. I have a script within the child package, which will set the value of the Parent package's variable (ChildErrCount). However, I have no idea how to access the Child package's Errors collection to get a count.
Any ideas? Has someone figured out a way to reference the current package's properties (besides what's available from Dts.* ?
Thanks!
View 11 Replies
View Related
Jul 31, 2006
Hi
We already used Oracle Datasatage Server the following Query statement for Source and Lookup.here there is parameter maping in the SQl Statement . How can achive in SSIS the Folowing Querystatment?
Query 1: (source View Query)
SELECT
V_RDP_GOLD_PRICE.GDR_PRODUCT_ID, V_RDP_GOLD_PRICE.ASSET_TYPE, V_RDP_GOLD_PRICE.PREFERENCE_SEQ, V_RDP_GOLD_PRICE.RDP_PRICE_SOURCE, TO_CHAR(V_RDP_GOLD_PRICE.PRICE_DATE_TIME,'YYYY-MM-DD HH24:MI:SS'), TO_CHAR(V_RDP_GOLD_PRICE.REPORT_DATE,'YYYY-MM-DD HH24:MI:SS'), V_RDP_GOLD_PRICE.SOURCE_SYSTEM_ID
FROM
V_RDP_GOLD_PRICE V_RDP_GOLD_PRICE
WHERE
REPORT_DATE = (select max(report_date) from V_RDP_GOLD_PRICE where source_system_id = 'RM' )
Query 2: (look up )
SELECT
GDR_PRODUCT_ID,
TO_CHAR(MAX(PRICE_DATE_TIME),'YYYY-MM-DD HH24:MI:SS') ,
TO_CHAR(REPORT_DATE,'YYYY-MM-DD HH24:MI:SS')
FROM
V_RDP_GOLD_PRICE
where
GDR_PRODUCT_ID = :1 and
report_date = TO_DATE(:2,'YYYY-MM-DD HH24:MI:SS') AND
PRICE_DATE_TIME BETWEEN TO_DATE(:2,'YYYY-MM-DD HH24:MI:SS') - 7) AND TO_DATE(:2,'YYYY-MM-DD HH24:MI:SS')
GROUP BY GDR_PRODUCT_ID, TO_CHAR(REPORT_DATE,'YYYY-MM-DD HH24:MI:SS')
please anyone give the sample control flow and how to pass the parameter?
Thanks & regards
Jeyakumar.M
View 1 Replies
View Related
Nov 30, 2015
I have created a ssrs report which connects to vertica database through odbc connection. When I try to pass parameter value through parameter (e.g.: column name IN (@parameter) ) then getting error message in query designer prompting "Error in list of values in IN clause. Unable to parse query text. ". Using sql server 2012 , visual studio 2010 version and HP Vertica 7.1 .
View 6 Replies
View Related
Jan 17, 2007
Good morning,
Well... As I said in other topics, I'm doing a clustering plugin for text mining. I'm facing many problems and, with your help, solving them one by one.
First of all, thanks a lot again.
Well... I've made a clustering function that is actually working very well. But I'm exporting its results to a log file I use as an algorithm trace for debugging.
My clustering method returns a vector containing information of what cluster each register belongs. For instance:
vector[0] = 1 -> The register of index 0 belongs to cluster 1.
vector[1] = 9 -> The register of index 1 belongs to cluster 9.
vector[2] = 2 -> The register of index 2 belongs to cluster 2.
...
And so on.
But... I know that none of the Navigation methods receives a structure like this one discribed above. I only use it to log the results to debug the algorithm.
But how to pass this information (what register (or test case) belongs to what cluster) to the Navigation ?
Thanks a lot again, and any help will be very appreciated.
View 1 Replies
View Related
Jun 5, 2008
I have a vb.net page that I need to display a list of employees who work in a specific office, based on a MatterID passed in a query string. But, I don't know how to get a value returned from one sql statement into a second. Here's what I'm trying to do...
From the QueryString, we know that the MatterID = 4 ( xxx.aspx?MatterID=4)
Knowing that the Matterid=4, I query the database to get the OfficeId for that MID (Select OfficeID from tMatter where Mid=4) ~This returns an OfficeID of 6
So, then I need to do another query to get the employees where OfficeID = 6 (Select EmployeeID from tEmployees where OfficeID = 6)
How do I do these in one query, or how do I use the Calculated Value for the OfficeID in the 2nd statement?
View 3 Replies
View Related
Nov 24, 2004
Is it possible from sql to use SAS as an object? And if so how?
I was recently tasked with Data Profiling and sitting next to me is a SAS developer, who just has to run a couple of functions, to do what has taken me days (and I haven't finished!). If I could call out to SAS and run the SAS functions it would be great. I have looked on the net and can see SAS calling out to SQL but not the other way round. Technically I'm probably not up to this but I don't want this to hold me back... so any help would be great.
View 4 Replies
View Related
Sep 26, 2005
okay..
Here is my first post from pass.
I am here on sunday getting ready for the first of 5 days of nothing but SQL Server
Every time i come to this thing i still get excited about the whole community thing.
who else from dbforums is going to be here? i would be interesting to put faces with those names.
in any event i will post interesting tidbits from the event if any come to mind. starting with the microsoft givaway of a copy of std edtion 2005 (when released) to any attendee. you get a coupon and you register a pin on a web site and they will send you a copy upon release. its a nice perk i guess, but msdn and the CTPs kind of take the savoir faire out of it.
oh well.
remember to post your name if you are attending.
View 14 Replies
View Related
Jul 20, 2005
is it possible to do:(A)declare @numberofitems Int@numberofitems = select max(itemorder)from store, department, etc.and pass the @numberofitems to a #tempStore table, like:(B)(store, department, @numberofitems,...)I got itemorder but not the number of items in each departmentAlex--Sent by 3 from yahoo part from comThis is a spam protected message. Please answer with reference header.Posted via http://www.usenet-replayer.com/cgi/content/new
View 2 Replies
View Related
Oct 19, 2006
Hey everyone I'm having trouble finding a way to pass a particular paramater, my main goal of this is to create a custom paging and sorting control for the DataList, but we wont worry about all the un-nessesarry code, here is what I am dealing with... Sub Page_Load()
Dim Conn As SqlConnection
Dim Query As String
Dim SqlComm As SqlCommand
Dim myDataReader As SqlDataReader
' Define connection object
Conn = New SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)
' Define query to retrieve main category values
Query = "SELECT [productMainCategory] FROM [User_Products] WHERE [productMainCategory] = @productMainCategory"
' Define command object
SqlComm = New SqlCommand(Query, Conn)
' Open connection to database
Conn.Open()
' Create DataReader
myDataReader = SqlComm.ExecuteReader()
' Iterate through records and add to array list
While myDataReader.Read()
IDList.Add(myDataReader("productMainCategory"))
End While
' Close DataReader and connection objects
myDataReader.Close()
myDataReader = Nothing
Conn.Close()
Conn = Nothing
' If page has not been posted back, retrieve first page of records
If Not Page.IsPostBack Then
Paging()
End If
End Sub
The Entire Point to this bit of code is to open a connection to the database find the category productsMainCategory, count all the fields with the Name 3D Art --> and save that number into an Array List where I will be using it later on in my code......The big old problem here is that it counts every single field in the productsMainCategory, Columb.........I need to figure out how to pass it a parameter so that it only counts my 3D Art --> fields, I have tried using this bit of code but nothing SqlComm.Parameters("@productMainCategory").Value = "3D Art -->"Does anyone have any ideas of how I might go about donig this?Thank You..
View 4 Replies
View Related
Mar 15, 2007
I cannot remember how to pass a value to a stored procedure. I would work this through but I am really running out of time, any help greatly appreciated. This is my stored procedure and I need to pass CompanyID from the code behind page in for the stored procedure @C_ID value.
PROCEDURE dbo.EditCompanyInfo @C_ID int, @CS_CompanyName nchar(100), @CS_City nchar(50) AS UPDATE tblCompanyInfo_Submit SET CS_CompanyName = @CS_CompanyName, CS_City = @CS_City WHERE C_ID = @C_ID RETURN
This is my aspx. page:
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server" > <asp:TextBox ID="TextBox1" runat="server"> </asp:TextBox> <br /> <asp:TextBox ID="TextBox2" runat="server"> </asp:TextBox> <br /> <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox><br /> <asp:DetailsView ID="DetailsView1" runat="server" DataSourceID="SqlDataSource2" Height="50px" Width="125px"> <Fields> <asp:CommandField ShowEditButton="True" ShowInsertButton="True" /> </Fields> </asp:DetailsView> <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString2 %>" InsertCommand="CompanyInfoSubmit" InsertCommandType="StoredProcedure" OnInserted="SqlDataSource2_Inserted" SelectCommand="SELECT CS_CompanyName, CS_City FROM tblCompanyInfo_Submit WHERE C_ID = @CompanyID " UpdateCommand="EditCompanyInfo" UpdateCommandType="StoredProcedure"> <UpdateParameters> <asp:Parameter Name="CS_CompanyName" Type="String" /> <asp:Parameter Name="CS_City" Type="String" /> </UpdateParameters> <InsertParameters> <asp:Parameter Direction="ReturnValue" Name="ReturnValue" Type="Int32" /> <asp:Parameter Name="CS_CompanyName" Type="String" /> <asp:Parameter Name="CS_City" Type="String" /> </InsertParameters> </asp:SqlDataSource> <br /></asp:Content>
CODE BEHIND:
public partial class aaatest : System.Web.UI.Page{ int CompanyID; protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { DetailsView1.ChangeMode(DetailsViewMode.Insert); TextBox1.Text = "insert"; TextBox3.Text = Convert.ToString(CompanyID); } } protected void SqlDataSource2_Inserted(object sender, SqlDataSourceStatusEventArgs e) { { foreach (System.Data.SqlClient.SqlParameter param in e.Command.Parameters) { string RValue = Server.HtmlEncode(param.Direction.ToString()); if ( RValue == "ReturnValue" && Page.IsPostBack) { TextBox1.Text = Server.HtmlEncode(param.Value.ToString()); TextBox2.Text = "Return"; CompanyID = Convert.ToInt16(TextBox1.Text); TextBox3.Text = Convert.ToString(CompanyID); } } } }}
View 1 Replies
View Related
Aug 3, 2007
I have a stored procedure that I want to pass in a number of months and use it in my where caluse. I need to minus the number of months that as passed in by @TaskMonths.
But it is minusing days not months.
@TaskMonths intWHERE (tblTasks.Caller = @Caller) AND (tblTasks.DueDate BETWEEN CONVERT(varchar, GETDATE() - @TaskMonths, 101) AND GETDATE()) I apprecaite any help.
View 2 Replies
View Related
Oct 31, 2007
I'm trying to pass a comma delimited list of numbers to a parameter to use in an IN of my Where clause.
Dim MySqlParamSelected As New SqlParameter("@Selected", SqlDbType.Int) Cmd.Parameters.Add(MySqlParamSelected) MySqlParamSelected.Value = Session("intSelected")
WHERE tblSelected.Selected_ID IN (@Selected)
It will work if I only pass it one number (e.g. 78), but when I pass it more than one (e.g. 78,79) it fails.
Here is the error:
Msg 119, Level 15, State 1, Line 4Must pass parameter number 7 and subsequent parameters as '@name = value'. After the form '@name = value' has been used, all subsequent parameters must be passed in the form '@name = value'.
Does anyone know how I can correctly pass multiple numbers to use in my IN?
View 11 Replies
View Related
Jan 29, 2008
How do i pass a parameter to a stored proc using this command:
object SqlHelper.ExecuteScalar (SqlConnection connection, string spName, params object[] parameterValues)
let's say that my parameter name is @ID and the value is IDval ..
thanx
View 2 Replies
View Related
Oct 20, 2000
Good morning one and all,
Does any1 know if when A SQL pass through query is executed in access (to a SQL srv dbase) wether or not access will wait until that call is completed before running other steps (in an macro say). I don't think it does but would appreciate a more definitive answer.
TIA for any and all help
Gurmi
View 6 Replies
View Related