Accessing Data Directly From A SqlDataSource?

Mar 7, 2007

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 1
1 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 1
First 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 

View 1 Replies


ADVERTISEMENT

Accessing Data From The SQLDataSource.

Apr 5, 2008

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 Related

SQLDATASOURCE ~ ACCESSING DATA PROGRAMATICALLY

May 9, 2007

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)

View 3 Replies View Related

Accessing Data From A Programmatically Created SqlDataSource

Nov 3, 2007

Hi
I think I've programmatically created a SqlDataSource - which is what I want to do; but I can't seem to access details from the source - row 1, column 1, for example????
If Not Page.IsPostBack Then
'Start by determining the connection string valueDim connString As New Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)
'Create a SqlConnection instanceUsing connString
'Specify the SQL query
Const sql As String = "SELECT eventID FROM viewEvents WHERE eventID=17"
'Create a SqlCommand instanceDim myCommand As New Data.SqlClient.SqlCommand(sql, connString)
'Get back a DataSetDim myDataSet As New Data.DataSet
'Create a SqlDataAdapter instanceDim myAdapter As New Data.SqlClient.SqlDataAdapter(myCommand)
myAdapter.Fill(myDataSet)Label1.Text = myAdapter.Tables.Rows(0).Item("eventID").ToString() -??????????????
'Close the connection
connString.Close()
End Using
End IfThanks for any helpRichard
 

View 1 Replies View Related

How To Pass Cube Values For Directly Accessing Reports From A URL

Feb 19, 2008



Hi,

Actually we have multiple Sub Reports which we want to open from the Main Report. Initially when i used "Jump To Report" property it worked fine but in the browser the Main Report used to get refreshed everytime i had to Go Back to Main Report from Sub Report.
Second solution which i want to try is using "Jump To URL" property.
Some Details:
I have multiple parameters in the report.
My parameters are getting data from a Cube.
Parameters can have Multiple Vaue selected at a time.
I want to pass all the values to the URL.

Say
Parameter1 is DimCountryCountry
can have values such as:
[Dim Country].[Country].[All]
[Dim Country].[Country].&[India]
[Dim Country].[Country].&[Germany]
......

Parameter2 is DimCountryState
can have values such as:
[Dim Country].[State].[All]
[Dim Country].[State].&[Delhi]
[Dim Country].[State].[Punjab]
.....

Now i want to create a URL using these values,since each parameter should be separated by "&"(ampersand) my URL looks like one below.
Following URL Works fine:
javascript:void(window.open'(http://MyReportServer/ReportServer/Pages/Report.aspx?/MyReports/Project1/Country+Data&rcarameters=false&DimCountryCountry=[Dim Country].[Country].[All]&DimCountryState=[Dim Country].[State].[All]'))

as long as there is no "&" in the Parameter Value the URL works fine.
But when i try to insert values other than "[All]" it starts failing because "[Dim Country].[Country].&[India]" contains "&", which gives error due to ambiguity, (whether this "&" is a parameter separater or is it a part of parameter value)

So i found a solution for that, which is to replace "&" with "%26" escape sequence characters.This works fine as long as we specify this escape sequence in address bar. i.e if we directly paste the following URL in the address bar it will work.
http://MyReportServer/ReportServer/Pages/Report.aspx?/MyReports/Project1/Country+Data&rcarameters=false&DimCountryCountry=[Dim Country].[Country].%26[India]&DimCountryState=[Dim Country].[State].%26[Delhi]

but if we put this URL in the Javascript, it doesnot work, because the WIndow.Open function automatically replaces the
"%26" characters with "&", which we know gives ambiguity error.

Please let me know if you have any suggesiton for it. Anyway any better solution for my problem.

Thanks
Sumit
www.sumitkhemka.com

View 4 Replies View Related

Writing Directly To A Database Using An SqlDataSource

Jan 31, 2008

Hey all Im trying to make a system in which users logged on can change their password. I dont want to use a grid view because that dosent give me the chance to let them put in their old password first for validation but now I need a way of takeing data out of the textbox with the new password and placeing it in to the field in a database.As I stand at the moment I have a data.dataview variable equal to an SQL Data Source with my query in it, bringing back a record from a users table with the users username, password and a field stating what type of user they are. It filters this by username which is stored as a session variable and username is the primary key. there is then an if statement checking that the string in the password field is equal to what the user has written in the old password box and if they match it uses the command:dv.Table.Rows(0)(1) = txtNewPassword.TextMsgBox("Password Successfully Changed", MsgBoxStyle.Information)When I run this the validation successfully checks the password is correct and then displays the message box saying the password is correct but it hasnt actually changed it. Somone I know told me that I need to use the command sqldatasource.update but I cant see where it fits in. Anyone got any ideas? 

View 2 Replies View Related

Accessing Value From SqlDataSource

Jan 24, 2007

I have a SqlDataSource that returns a list of companies and their details by ProductID.  It also returns the name of the product associated with the ProductID as the final column (which means it appears for every record returned).  I already have a way of determining how many rows were returned, and use that information in a label to say "Your search has returned x records". protected void dsGetSuppliersByProduct_Selected(object sender, SqlDataSourceStatusEventArgs e)    {        int RecordCount = e.AffectedRows;        if (RecordCount == 0)        { lblRecordCount.Text = "<p>No Records found"; }        else        {            if (RecordCount == 1)            { lblRecordCount.Text = "<p>Your search returned 1 record"; }            else            { lblRecordCount.Text = "<p>Your search returned " + RecordCount + " records"; }        }        string ProductName;    }How can I access the ProductName value so that I can extend the label text to say "Your search has returned x records for <ProductName>" ?

View 1 Replies View Related

Accessing SqlDataSource's Value In Code Behind

May 30, 2007

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.  

View 1 Replies View Related

Programmatically Accessing An SQLDataSource With A SELECT COUNT(*) Query.

Jun 20, 2007

I've found example code of accessing an SQLDataSource and even have it working in my own code - an example would be  Dim datastuff As DataView = CType(srcSoftwareSelected.Select(DataSourceSelectArguments.Empty), DataView)  Dim row As DataRow = datastuff.Table.Rows(0)   Dim installtype As Integer = row("InstallMethod")  Dim install As String = row("Install").ToString  Dim notes As String = row("Notes").ToString The above only works on a single row, of course. If I needed more, I know I can loop it.The query in srcSoftwareSelected is something like "SELECT InstallMethod, Install, Notes FROM Software"My problem lies in trying to access the data in a simliar way when I'm using a SELECT COUNT query. Dim datastuff As DataView = CType(srcSoftwareUsage.Select(DataSourceSelectArguments.Empty), DataView) Dim row As DataRow = datastuff.Table.Rows(0) Dim count As Integer = row("rowcnt") The query here is "SELECT COUNT(*) as rowcnt FROM Software"The variable count is 1 every time I query this, no matter what the actual count is. I know I've got to be accessing the incorrect data member in the 2nd query because a gridview tied to srcSoftwareUsage (the SQLDataSource) always displays the correct value. Where am I going wrong here?  

View 6 Replies View Related

Extract Outlook Contacts Data(on Public Directory) Directly In Data Flow

Jun 13, 2006

Hi everyone,

I have to extract, dayly a list of contacts on a exchange server in a table on our EDW on sql server 2005. Is it possible to get the information directly from a dataflow or i will have to developpe a script task ?

Need help desperatly !!!

View 3 Replies View Related

Inputing Data Directly Into A Table

Feb 19, 2004

hi
im new to Sql server so this might be a daft question

is there something where i can put data directly into a table (i.e entering data into a grid) or do i have to write the sql every time

View 3 Replies View Related

Is It Possilbe To Load My Data Directly?

Oct 3, 2006

I have thousands of records, which are .txt format, to be loaded to the DB and need to mining them. The only way for that is to write a program and read them to the DB or can I load them directly? And also I have to design the tables based on these data myself, right? Thank you.

View 6 Replies View Related

Using SSIS To Connect Directly To Outlook As Data Source

Sep 5, 2006

Can I connect directly to Outlook using SSIS? If so is there any white paper or walkthroughs I could follow?



TIA



Tom

View 1 Replies View Related

Automatic Extract Data From Database, Then Generate A Report &&amp; Print It Directly

May 7, 2008

hi lads,


what i need to do for my project are as following:

a mobile user send data via GPRS to SQL server Database. then i need to have a method to detect while a particular table is being inserted. and then extract data from table construct a report dynamiclly. what should i do to achieve this goal? e.g. window application, store procedure or trigger ?

PS : client side is a mobile application developed using MCL. i don't in which way he will send all data to SQL server Database, so what i need to do is to monitor new data inserting.



2) how to auto generate and print report directly after record been inserted into the table ? Do i need to import report web service API ? if yes, which one? or i can use other methods e.g. predefine report control view in my window application, turn off pop-up menu while printing a report(I guess)

thanks

View 2 Replies View Related

Database Create ODBC Connections To Access Database Directly And Update Data?

Sep 10, 2012

We have a SQL database that uses Active Directory with Windows Authentication. Can users that are members of the Active Directory group that has read/write access to the SQL database create ODBC connections to access the database directly and update the data? They dont have individual logins on the server. They are only members of the Active Directory group that has a login?

View 1 Replies View Related

I Am Accessing Data Using Data Access Pages In IIS 7 To SQL Server 2005 Authentication Is Failing

Feb 5, 2007

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.

View 1 Replies View Related

Data Access :: Users Get Wrong Data Records - Cross Coupling When Accessing Files From MVC App

Aug 7, 2015

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.

View 8 Replies View Related

Accessing Data In A Column

Oct 18, 2006

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 Related

Accessing Data In Different Database

Jan 22, 2007

Hello 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.

View 1 Replies View Related

Code For Accessing Data

Jan 3, 2008

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! 

View 6 Replies View Related

Accessing Data In One Field

Jun 20, 2008

There 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?

View 4 Replies View Related

About Accessing Data From Sqlserver

Sep 15, 2005

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 Related

Accessing Data Across 6.5 Servers

Jun 22, 1999

Hi,

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

View 1 Replies View Related

Oracle Accessing Data

Oct 22, 2001

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

View 1 Replies View Related

Accessing AS400 Data

Jun 17, 2005

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

Accessing Different Languages Data

Jan 24, 2008



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.

View 1 Replies View Related

Accessing SQL Server Data Using Thread

Sep 17, 2007

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
 
 

View 2 Replies View Related

Accessing Database Data In ASP.NET 2.0 - Best Practices?

Dec 31, 2007

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 Related

Accessing Data Structure Of A MS SQL Database

Mar 19, 2008

I 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 Related

Accessing Sql Server Data From Unix

Apr 5, 2001

Hello !

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

View 3 Replies View Related

Problem In Accessing Remote Data?

Jun 26, 2000

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

View 1 Replies View Related

Accessing Data From VB6 - Query Builder&#39;s

Jan 7, 1999

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

View 1 Replies View Related

Accessing External Data From SQL Server

Mar 21, 2007

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







Copyrights 2005-15 www.BigResource.com, All rights reserved