Code For Accessing Data
Jan 3, 2008Does anyone have code to access data? I want to create a sqldatasource control on the page, but would like to programmatically/manually/code-behind-wise to fill in my queries and their parameters.
Thanks!
Does anyone have code to access data? I want to create a sqldatasource control on the page, but would like to programmatically/manually/code-behind-wise to fill in my queries and their parameters.
Thanks!
Hi guys,
I have following query in stored procedure Select ContractId, Version, CreateDate, body, IsCurrentFrom CRM_Contracts where ContractId=@ContractId I am trying to access the value of IsCurrent field in Code behind using sqlDataSource to hide a radiobutton list in Formview control's when it is in Edit Mode. How can i do this.
I have the following datasource...
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ***%>"
ProviderName="<%$ ***%>" SelectCommand='SELECT "var1", "var2", "var3" FROM "tbl1"'>
</asp:SqlDataSource>
Would it be possible to use VB code to read the reasults from this datasource? (There are conditions that restrict me from running the query itself through VB code.)
As always, any help is greatly appreciated. Thanks!
Hi
I am not able to access SSIS variables which are defined at Data Flow Task in a custom component. This custom component is developed by me in C#. How can i access these variables?
Please let me know if theres a way to access SSIS variables.
Thanks,
Vipul
Hi,
I am trying to retrieve and manipulate the value of the stored procedure parameters in the following custom code:
Code Snippet
Public Function ShowLoading(ByVal intOption as integer, byVal BasicLoading as string, byVal BasicHealthExtra as string, byVal RiderLoading as string, byVal RiderHealthExtra as string, byVal TotalAmount as string) As string
dim strRider as String
dim strCompanyName as string
strCompanyName = Fields!CompanyName.Value
select case strCompanyName
case "and Plus Rider ":
strRider = "Plus Rider"
case "and Assist Rider ":
strRider = "Assist Rider"
end select
return strRider
End Function
However, i got this error when I try to preview the report: An error occurred during local report processing, The definition of the report :
'/reportC' is invalid. There is an error on line 5 of custom code: [BC30469] Reference to a non-shared member requires an object reference.
Any help is greatly appreciated. Thanks in advance.
Hi,
My report has multiple datasets, and I want to access the fields of a particular dataset from custom code. The problem is that the name of the dataset to use is only calculated during the execution of the custom code.
Allow me to illustrate:
public function Test(data as DataSets, fieldName as string)dim datasetName as string = CalculateDatasetName()dim ds as Dataset = data(datasetName)' now here I want to get the fieldName out of the dataset.' in the report, I would do something like
' First(Fields!fieldName.Value, datasetName)' but in custom code, this obviously doesn't work.end function
I've been looking for a way to accomplish this, but it seems you cannot get data from a dataset through custom code (there is only the commandtext property). Also it is not possible to pass the Fields collection as a parameter, as I do not know the dataset name when in the report designer.
I hope my problem description is clear.
Does anyone know how to solve this issue?
Thanks,
Phil
I am trying to access HttpContext.Current in my report code section (report properties) since I have to look at a cookie. However, HttpContext.Current is always null. Has anyone managed to access HttpContex.Current from a report?
Thanks in advance.
is there a step by step paper to get there? here is what i need to consider. I Iwill have many customers that will need their own set of records and access pages "branded for their company" each customer will have many clients. I am hosting this application on a windows 2003 server with SQL 2005 server enterprise.
I am using windows authentication, I have created a username in windows, then i added the windows user in SQL management studio in security, granted "DB Read" and "DB write" and again under the database security tab. still from the web authentication fails. i must be nissing a step or two?
I expect to set up a username for each database as i setup new customers.
I have an MVC asp.net application that stores many records in a table on sql server, in its own system. used the system for 2 months, worked fine accessing, changing data.
Now that other users are logging in? there is cross coupling going on. one user gets the data from another users sql search.
In the mvc app it had used the get async method to read the ID record from the db, i set that to synchronous. no effect; the user makes their own login id but that does nt matter either.
I have a SQLDataSource returning data for a formview. This should be a simple question that I cannot find an answer to. The SQLDataSource is returning only one row of data. How do I access the value of one of the columns?Thanks for the information.
View 3 Replies View RelatedHello Everyone,
Is it possible to write a query that can access data in differnt database so I have "trainee" and "training" databases. In want to access one training table in trainee database through a query. How can I do this.
Thanks.
I am using a drap and drop SQLDataSource control. Everything works like I am wanting it to, but I want to check a value from one of the fields that I have retrieved. I am lost as how to retreive just the field. If I have to create another dataset to do the work what is the point of using the drag and drop control? I would really like to just access the dataset fields as needed.
View 2 Replies View RelatedThere has to be a better way (less code) to grab the data in one field than:string sql0 = "Select PSI from agentRate where agent='" + agent + "'";
SqlCommand command0 = new SqlCommand(sql0, conn2);SqlDataReader dr0 = command0.ExecuteReader();
string PSI="";while (dr0.Read())
{PSI = (string)dr0["PSI"];
}
dr0.Close();
Any Thoughts?
Hello sir,I have installed .net1.1version on windows2003 operating system.I have also installed sqlserver2000 on the same system.My problem is that when i am trying to get data from sqlserver from asp.net program i am getting error as 'access denied to user NT AUTHORITY/NETWORK USER'.I request you to kindly suggest me with an appropriate solution.Thanking you.Please email me on:-aanandkumar786@yahoo.com
View 1 Replies View RelatedHi,
I need to access data across my sql servers . All the servers are 6.5. Think MS DTC is the solution. But how to implement the same. Can somebody give me step by step instructions.
Thanks in Advance.
Cheers
There is any tools or products that allow Oracle Users to access SQL 2000 data in realtime? I know how to go in the opposite direction using linked servers, but am not sure on this direction,
Thanks
David
I've been trying to use the integrations services to access AS400 data with almost no success. Any suggestions or help you can give me would be appreciated. Some of the issues I can't make sense of are the following.
View 11 Replies View Related
Hi,
My source is Excel and one column has data in different languages. But when i try loading it to my Database errant data gets loaded.
I tried loading data to Flat file with no success.
Thanks in advance.
First let me give you a little back ground on me. I'm very new to the ASP, ASP.NET, Visual Studio, Sql Server, Frameworks....thing. I am coming over from a PHP/MySql background of over 5 years. The change over to VBScript and VB has been to tough and I have a basic liking for the Visual Studio 2005 and the ease of putting things together. However, I have come across something that to me seems like it should be relatively simple, but haven't been able to find the documentation or samples to describe what I'm looking to do.
Rough Need:
1. Start with a form will a couple labels and a singe textbox to get the lookup date from an user.
2. Query one table/view based on the users choice of date and select only one field of returned data.(Doing this by itself is not a problem and I can display my results in a Gridview, but this is where it starts getting tricky and the gridviews won't work for me.)
3. If there is something returned, I need to start a HTML table layout or possibly some form of a Gridview(I don't see how I would use the Gridview) and start a loop, adding the first returned row from this query into the first cell.
4. Now, based on that same User Date and the returned row value from the previous query, I need to query another Table/view and return another single field, which might return 1 or multiple rows, which I need to start a loop to display unique items in cells under the first on above.
5. Based on the original User Date and each returned row from the first query, I need to query two other Table/views and get some additional information. 4-5 fields will be returned and be displayed on one row in the number of necessary columns.
6. This would finish the first row from the first query, so I would need to loop back up to see if there were any further results and continue looping until the get to the last of the results from the first query.
7. Finally, I would just need to close up the Table/gridview.
The basic results I'm looking for would be similar to the following:
Results for 10/11/2005
Field name 1
Field name 2
Field name 3
Field name 4
Field name 5
First Result from query 11 of 4 results from Query 2, but only 1 unique result
Info from Query 3
Info from Query 3
Info from Query 3
Info from Query 4
Info from Query 4
Info from Query 3
Info from Query 3.
Info from Query 3
Info from Query 4
Info from Query 4
Info from Query 3
Info from Query 3
Info from Query 3
Info from Query 4
Info from Query 4
Info from Query 3
Info from Query 3
Info from Query 3
Info from Query 4
Info from Query 4
Second Result from query 1First result from Query 2 after looping though the first query Second result from Query 2 after looping though the first query
Info from Query 3
Info from Query 3
Info from Query 3
Info from Query 4
Info from Query 4
Info from Query 3
Info from Query 3.
Info from Query 3
Info from Query 4
Info from Query 4
Info from Query 3
Info from Query 3
Info from Query 3
Info from Query 4
Info from Query 4
Info from Query 3
Info from Query 3
Info from Query 3
Info from Query 4
Info from Query 4
It seems me from what I have read and slowly figuring out, is that I should be able to directly access the DataSet returned by four SqlDataSources, one for each of the above querys and then just write my own VB to handle the necessary looping, table format and such. I can easily add the for SqlDataSources to the page and add a Gridview for each one and get 4 separate chunks of info, but can't see a way with GridViews to intermingle the info like displayed above.
So, if it can be done with Gridviews, then I would love to see how that is done. But, if someone could explain to me how I access the DataSets directly that I get from the 4 SqlDataSources, then that would be ok too. I have figured enough out with VB, that I can write the code to do my looping requirements, if I can just access the information I get back. Thanks for reading all the way through this long post.
Jack
Can anyone point me in the direction of code that will allow me to acce3ss the data held in an SQLDataSource.
The Control is link Selection Staement has been set at run, what I want to do is loop thru any data that is rertrieved, setting oter controls on the page depending on values
Thanks
Steve (I have not got much hair left, please help soon)
Hi,
How do we set credentials or contex to a thread.
I create a new thread and within that thread if I am use a connetion string with Integrated Security=True" to talk to the SQL Server, however it seems that the new thread's context/identity is blank and hence failing the SQL Server connection.
Please help.
Thanks
I was wondering if you guys know of a good site that talks about programmatically accessing and displaying data from a sql server 05 database in ASP.NET 2.0.I want to have a data adapter in a dataset, but I would like to create my own class file and pull the data from the adapter through code into the class. Is this the best way? Im wondering about the best practices while learning this new technology. Any articles provided would be appreciated. Thanks!
View 2 Replies View RelatedI have written 5 content-management systems and am getting a little bored writing a lot of the same functionality and tweaking it for different datamodels. Is there a way within .NET to have visibility of a database's structure (ie, data type, column names, foreign keys etc)? I'd like to write up a dynamically generated form for any given table, displaying appropriate form controls based on data type and foreign keys.
View 7 Replies View RelatedHello !
I am owrking in java developmenton solaris using weblogic6.0
Does any body know how to access sql server data from solaris.
If some body knows that, can you please post me the steps
that i need to do it.
Thanks
Veena
hi,
I am trying to access data from a remote database which is on SQL SERVER from my local SQL SERVER.. the below is my query..
select * from Remote_server.Remote_DB.dbo.RemoteTable
When i execute this query...
I get a error message..
Server: Msg 7411, Level 16, State 1, Line 1
Server 'remote_server' is not configured for DATA ACCESS.
I added my local server in the remote server as linked server
can anyone tell me the sol...
thanks
We have SQL Server 6.5 with an Access 8.0 front-end. We are about to re-write our front-end in VB6 using RDO. Obviously Access has a nice fast and easy to use query builder. My question therefore is - is there any such query builder that can be used within VB6 to simplify query writing ? Or do I have to write all query's and and stored procedures using straight SQL and/or stored procedures. I do not want to use Visdata as it doesn't appear up to the task.
Thankyou whoever helps
Paul
Hi,I have a Sybase dataserver containing lots of (huge) tables that Iwould like to access from SQL Server (two different applications,using two different datasources, now want to talk to each other). MSAccess has a feature for 'linking' external data. Can I do similarstuff in SQL Server?Basically, I am trying to avoid having to duplicate the data in boththe dataservers and worry about keeping them in sync.Regards,Tanveer
View 3 Replies View Related
How can i get the shared data sources i created in the report manager to be available in VS.net to be able to assign to a report. I want to be able to create the shared data source first in Report manager and then be able to assign it a report in VS.Net
Thanks.
Hi,
I am trying to do this select over a SAP table:
select * from KNA1
But in DataReader component raises an error pointing that Z_EXTRACT_DATA_FULL function module can't be found.
Anyone know where is the problem??
Thanks!
I have created a report using Visual Studio that brings back the expected information from the database when either run from within VS or is deployed to the server and run through Internet Explorer. The problem that I have is that records on the database each has a field that contains the location of a photograph file which is located on a different server. When I run the report from within VS on my PC it correctly includes the photo but when I run it from the server the picture just shows the icon denoting a broken link - although all of the database information is correctly displayed.
I think this may be a security problem as my workstation user has Domain Administrator capabilities but I am not sure which user is being used by Reporting Services when it tries to access the photo files from the other server. I have made sure that the user configured in Windows Service Identity also temprarily has Domain Admin rights but this has not made any difference.
Can anyone shed any light on which user the server uses when it runs on the server and tries to access network based information.
Thanks
Hi,
I've a custom database with created by Dynamics CRM setup. When i access this database using the user who installed it, It returns full data. But when i try to access the same tables using some other username e.g. [sa] / [any other user], it doesn't return me even a single record. Database instance is set to mix mode authentication, and i can connect using username [sa], but no data is available from 1 perticular database.
I've even given select rights to [public] on that specific database, but no results. Can anyone help me getting results using these usernames?
Is there a way to access cubes via a web service?
Are there any built in web services for doing this in SSAS?
Do I have to have the ADOMD client installed before I can access or use data if it were possible to access it via a web service?
After reading some threads on this forum about accessing OLAP data from SSIS via an OLE DB Source component (and trying it myself and getting that "pcrsstore.cpp line 325" error), I have worked around the problem by using a Script Task component.
This calls a .NET assembly I wrote that uses ADOMD.NET to get at the data using an MDX query, and then actually posts an event to a Notification Services instance via a stored proc.
Writing, deploying, and maintaining a .NET assembly is more than I wanted to do, but it was worth the effort since now I know a little about extending SSIS when I need to.
But what I really wanted to do was the following, all from within the core components of SSIS:
Import my OLTP data into my relational warehouse (already done using SSIS)
Process the cube (already done using SSIS)
Access the cube via MDX and post an event to Notification Services
It's this last step that needed some special work because of SSIS's apparent limitation accessing cube data (although posting the event to NS would be easy because SSIS can call a stored proc on the NS application database).
So I'm hoping that a future release or service pack of SSIS will give us some components to run MDX and get the OLAP data into the pipeline as if it were from any other source.
Thanks for reading, and if anyone has any suggestions on a better way to achieve what I need please let me know!
-Larry