Display Data From Database

Oct 10, 2006

 
 I've always bound data to a dataset...
how do I display data without a dataSet?
 
This is how i usually display data... 
                SqlConnection myConnection = new SqlConnection(conn);
                string sqlQuery = "SELECT * FROM questions";
                SqlDataAdapter myCommand = new SqlDataAdapter(sqlQuery, myConnection);

                DataSet ds = new DataSet();
                myCommand.Fill(ds, "questions");
                MyDataGrid.DataSource = ds.Tables["questions"].DefaultView;
                MyDataGrid.DataBind();
 
<%# DataBinder.Eval(Container.DataItem, "answer3")%> 
 

View 1 Replies


ADVERTISEMENT

Display Data From A Database Without Using Gridview Etc.

Mar 19, 2008

I have a webform that I am wanting to display data from a database. Right now I am using the gridview but for future purposes when it comes to maintenance what would be the easiest way to do updates? For example, if I add a new record into the database I would like the webform to automatically update itself to show all the records including the new record I added. Do I need to use a "table" and somehow connect it to a database? Do any stored procedures need to be created? Suggestions/ideas/codes help help help would be verrrry much appreciated!!! Also I am using MS Server 2003 and C# as the programming language. Thank you!!!!

View 9 Replies View Related

Display First Part Of Data In Database

Mar 28, 2008

I have a tabe in my sql server 2005 database which contains a long description and I want to display the first 100 charactors  on my web page but not sure how to do this I can only display the whole description. I'm not sure if I need to write the query to the database so it only brings the first 100 charactors back or query the whole description and then take the first 100 charactors in asp.net and display that can any one help

View 3 Replies View Related

Retrieve Data From Database And Display It In A Label

Jan 21, 2008

Below is code for inserting data into the database that I know works, so I thought if I replace  "Insert" with "Select" I could retrieve a specific row from my database and present it in a label or text box but nothing happened. How can I retrieve a row or rows from a database using vb code and display it in a textbox? I'm using visual web developer 2008 which is similar to 2005.
Thank you.
 
 Dim UserDatasource As New SqlDataSourceUserDatasource.ConnectionString = ConfigurationManager.ConnectionStrings("ASPNETDBConnectionString1").ToString()
 
UserDatasource.InsertCommandType = SqlDataSourceCommandType.Text
UserDatasource.InsertCommand = "insert into table1 (Username, comments, points,totalpoints, ipaddress, datatimestamp) values (@Username, @comments, @points,@totalpoints, @ipaddress, @datatimestamp)"
 
 UserDatasource.InsertParameters.Add("username", Context.User.Identity.Name)
UserDatasource.InsertParameters.Add("comments", txtSearch.Text)UserDatasource.InsertParameters.Add("points", points)
UserDatasource.InsertParameters.Add("ipaddress", Request.UserHostAddress)UserDatasource.InsertParameters.Add("datatimestamp", DateTime.Now())
 Dim rowaffected As Integer = 0
 
Try
rowaffected = UserDatasource.Insert()MsgBox("Thanks for the post", MsgBoxStyle.OkOnly, "Post Executed")
txtSearch.Text = ""Catch ex As Exception
MsgBox("Please sign in or sign up to post comment", MsgBoxStyle.OkOnly, "Login Error")
End Try
 

View 2 Replies View Related

Stored Procedure To Display The Relevant Data Of The IDs In The Database To A Gridview

Mar 7, 2008

Here is the Stored procedure 
ALTER procedure [dbo].[ActAuditInfo](@IndustryName nvarchar(50) output,@CompanyName nvarchar(50) output,@PlantName nvarchar(50) output,@GroupName nvarchar(50) output,@UserName nvarchar(50) output
)asbegindeclare @AuidtID as varchar(30)Select @IndustryName=Industry_Name from Industry whereIndustry.Ind_Id_PK =(Select Audit_Industry from Audits whereAd_ID_PK=@AuidtID)Select @CompanyName=Company_Name from Company whereCompany.Cmp_ID_PK =(Select Audit_Company from Audits whereAd_ID_PK=@AuidtID)Select @PlantName=Plant_Name from Plant where Plant.Pl_ID_PK=(Select Audit_Plant from Audits where Ad_ID_PK=@AuidtID)Select @GroupName=Groups_Name from Groups whereGroups.G_ID_PK =(Select Audit_Group from Audits whereAd_ID_PK=@AuidtID)Select @UserName=Login_Uname from RegistrationDetails whereRegistrationDetails.UID_PK =(Select Audit_Created_By fromAudits where Ad_ID_PK=@AuidtID)SELECT Ad_ID_PK, Audit_Name, @IndustryName, @CompanyName, @PlantName,@GroupName, Audit_Started_On, Audit_Scheduledto, @UserName FROMAudits where Audit_Status='Active'end
U can see here different parameters,my requirement is that iam havingID's of Industry,company,plant,group,username stored in a table calledPcra_Audits and i must display their related names in the front end.so this is the query iam using for that.
Data in the database:Commercial83312 2       2       2       1       1       InactiveHere u can see  2,2,2,1,1 these are the IDs ofindustry,company,plant,group and username and Commercial83312 is tehaudit ID.now i want to display this data in teh front end as i cannot displaythe IDs i am retrieving the names of the particular IDs from therelated tables.Like iam getting name of the IndustryID from Industry Table,in thesame way others too.when iam running this procedure iam getting the gridview blank.iam passing the output parameters:@IndustryName nvarchar(50) output,@CompanyName nvarchar(50) output,@PlantName nvarchar(50) output,@GroupName nvarchar(50) output,@UserName nvarchar(50) outputinto the function in the frontend and iam calling that into the pageload method.please help me with this.

View 1 Replies View Related

How To Access Data From Different Database And Display Result Set In Managed Stored Procedure

Jan 31, 2008

Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.SqlTypes
Imports Microsoft.SqlServer.Server
Imports System.Data.OleDb
Imports System.Configuration
Imports System.Text
Imports System.Collections

Partial Public Class StoredProcedures
<Microsoft.SqlServer.Server.SqlProcedure()> _
Public Shared Sub StoredProcedureTest(ByVal strAS400ServerName As String, _
ByVal strCompany As String, _
ByVal decSerial As Decimal, _
ByVal strSerialCode As String, _
ByVal strSerialScan As String, _
ByVal decMasterSerialNumber As Decimal, _
ByVal strCustomerPart As String, _
ByVal strTakataPart As String, _
ByVal strCustomerRanNo As String, _
ByVal strCustomerAbv As String, _
ByVal strDestinationAbv As String, _
ByVal decQty As Decimal, _
ByVal strCreatDate As String, _
ByVal decVoidSerialNo As Decimal, _
ByVal strProductionLineNo As String, _
ByVal strProcType As String)

Dim sp As SqlPipe = SqlContext.Pipe
Dim strResult As Integer = 0
Dim strErrorText As String = String.Empty
Dim dsData As New DataSet
Dim parameter(15) As OleDbParameter
If Not strAS400ServerName Is Nothing And strAS400ServerName <> String.Empty Then
' Populate parameter collection

parameter(0) = (CreateParameter("PARM1", OleDbType.Char, 20, ParameterDirection.InputOutput, strAS400ServerName))
parameter(1) = (CreateParameter("PARM2", OleDbType.Char, 2, ParameterDirection.InputOutput, strCompany))
parameter(2) = (CreateParameter("PARM3", OleDbType.Decimal, 10, ParameterDirection.InputOutput, decSerial))
parameter(3) = (CreateParameter("PARM4", OleDbType.Char, 2, ParameterDirection.InputOutput, strSerialCode))
parameter(4) = (CreateParameter("PARM5", OleDbType.Char, 25, ParameterDirection.InputOutput, strSerialScan))
parameter(5) = (CreateParameter("PARM6", OleDbType.Decimal, 10, ParameterDirection.InputOutput, decMasterSerialNumber))
parameter(6) = (CreateParameter("PARM7", OleDbType.Char, 30, ParameterDirection.InputOutput, strCustomerPart))
parameter(7) = (CreateParameter("PARM8", OleDbType.Char, 15, ParameterDirection.InputOutput, strTakataPart))
parameter(8) = (CreateParameter("PARM9", OleDbType.Char, 15, ParameterDirection.InputOutput, strCustomerRanNo))
parameter(9) = (CreateParameter("PARM10", OleDbType.Char, 6, ParameterDirection.InputOutput, strCustomerAbv))
parameter(10) = (CreateParameter("PARM11", OleDbType.Char, 6, ParameterDirection.InputOutput, strDestinationAbv))
parameter(11) = (CreateParameter("PARM12", OleDbType.Decimal, 9, ParameterDirection.InputOutput, decQty))
parameter(12) = (CreateParameter("PARM13", OleDbType.Char, 10, ParameterDirection.InputOutput, strCreatDate))
parameter(13) = (CreateParameter("PARM14", OleDbType.Decimal, 10, ParameterDirection.InputOutput, decVoidSerialNo))
parameter(14) = (CreateParameter("PARM15", OleDbType.Char, 3, ParameterDirection.InputOutput, strProductionLineNo))
parameter(15) = (CreateParameter("PARM16", OleDbType.Char, 2, ParameterDirection.InputOutput, strProcType))

RunDB2Sp("FABLE.MAP", parameter, dsData)

If dsData.Tables.Count > 0 Then
dsData.Tables(0).TableName = "Supreeth"
Dim bitresult As String = dsData.Tables(0).Rows(0)(0).ToString()
Dim errorstring As String = dsData.Tables(0).Rows(0)(1).ToString()

' I am not sure here
SqlContext.Pipe.Send(bitresult)
SqlContext.Pipe.Send("No errors")


End If

Else
Throw New ArgumentException("AS400Db.GetAS400TraceabilityResult: AS400 server name is empty or invalid")
End If

End Sub

Public Shared Sub RunDB2Sp(ByVal strProcedure As String, ByRef parms As OleDbParameter(), ByRef dsData As DataSet)
'*********************************************
' Declare Variables
'*********************************************
Dim daAdaptor As OleDbDataAdapter
Dim cmdAS400 As OleDbCommand
'Dim dstestMe As New DataSet
Try
cmdAS400 = CreateCommand(strProcedure, parms)
daAdaptor = New OleDbDataAdapter(cmdAS400)

' Fill the Data Set
daAdaptor.Fill(dsData)
Catch expError As OleDbException
daAdaptor = Nothing
Finally
daAdaptor = Nothing
cmdAS400.Dispose()
'Me.Close()

End Try

End Sub
Public Shared Function CreateParameter(ByVal name As String, _
ByVal type As OleDbType, _
ByVal size As Integer, _
ByVal direction As ParameterDirection, _
ByVal paramValue As Object) As OleDbParameter
Dim param As OleDbParameter = New OleDbParameter
param.ParameterName = name
param.OleDbType = type
param.Size = size
param.Direction = direction
param.Value = paramValue
Return param
End Function

Private Shared Function CreateCommand(ByVal strProcedure As String, ByVal prams As OleDbParameter()) As OleDbCommand
Dim CmdSAS400 As OleDbCommand
Dim parameter As OleDbParameter
Dim connAS400 As OleDbConnection
connAS400 = New OleDbConnection("Provider=IBMDA400;Data Source=AHISERIESDEV1;User Id=****;Password=****;")
connAS400.Open()

CmdSAS400 = connAS400.CreateCommand()
CmdSAS400.CommandText = strProcedure
CmdSAS400.CommandType = CommandType.StoredProcedure
CmdSAS400.Parameters.Clear()
'CmdAS400.CommandTimeout = intTimeOut
If (prams Is Nothing) Then
Else
For Each parameter In prams
CmdSAS400.Parameters.Add(parameter)
Next

End If

Return CmdSAS400

End Function

I have a UI which supplies 16 parameters to my stored procedure , which in turn call another sored procedure on as400 which returns result set. So far i am able to send 16 parms and get the values in dataset.
My question here how would i send the result set to UI for display, please feel free to comment on any changes need to be made on code . I badly need to find a solution for this and i appreciate any feed backs

Thanks

View 3 Replies View Related

Reporting Services :: Display Columns When There Is No Data To Display

Apr 30, 2015

I would like to display a portion of report where there is data or no data

There is data subreport  display   

     Product Name Latex Gloves  
     Product ID      
xxxx5678

 There NO data in the subReport
 
  Product Name                          
   Product ID    

View 3 Replies View Related

How Can I Send Row Data To A SQL Database Table Via VB 2008, And Permanently Save And Display The Result?

Mar 11, 2008

This is related to:
How can I make some graphics drawings stick while others disappear?
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2905460&SiteID=1


Except that now I am trying to connect and update to an Microsoft SQL Server Database File (SqlClient) via VB 2008 Express; specifically a table called €œHexMap€? that contains some columns that I am ready to insert some row data into. Here is what my program should do:

As I hover over a hexagon map of the US a red flickering hexagon follows the location of my mouse cursor. If I click on a given hexagon, the program draws a permanent blue hexagon, and sends a new set of row data into my database. Such information as the name of the state, row, column, center x, and center y, etc. Here is a quick snapshot of this program in action:

http://farm4.static.flickr.com/3128/2325675990_4155edbdee_o.jpg
-sorry, I didn't capture the mouse cursor inside the red hexagon

I think I am missing something since I appear to be able to connect successfully to the database table. Unfortunately, I never see the changes in the database, when I try to Show Table Data (via Database Explorer). I am hoping someone will review my code snippet (below) and tell me what I am missing. What happens when I run this code is that it acts like it works just fine, except that I have no indication that any changes were actually affected.




Code Snippet
'======================================================================================
Dim CN As New SqlClient.SqlConnection()
Dim da As New SqlClient.SqlDataAdapter

'Consider using Me._adapter that is used already

CN.ConnectionString = "Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|Mapboard.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
CN.Open()

'Use the following code to verify that a connection to the database has achieved
If CN.State = ConnectionState.Open Then


MsgBox("Workstation " & CN.WorkstationId & "connected to database " & CN.Database & "on the " & CN.DataSource & " server")
End If

Try

Catch ex As Exception MsgBox("FAILED TO OPEN CONNECTION TO DATABASE DUE TO THE FOLLOWING ERROR" & vbCrLf & ex.Message)
End Try

'use the Connection object to execute statements
'against the database and then close the connection
da = New SqlClient.SqlDataAdapter("select * from HexMap order by Territory", CN)

If CN.State = ConnectionState.Open Then CN.Close()
'==========================================================================

Dim rows As Integer

rows = 0

Dim CMD As New SqlCommand("INSERT HexMap (Hexagon, HexRow, HexCol, HexX, HexY, Territory) VALUES(HexCounter, CaptureRow,CaptureCol,Hx,Hy,Territory_ComboBox1.Text)", CN)

CN.Open()

rows = CMD.ExecuteNonQuery

If rows = 1 Then
MsgBox("Table HexMap updated successfully")
Else
MsgBox("Failed to update the HexMap table")
End If


If CN.State = ConnectionState.Open Then CN.Close()
'==========================================================================



Thanks for reviewing my code.

Technozoide

View 1 Replies View Related

Display Hirearchy Data Using Data Region

Jul 9, 2007

I am trying to display hirearchical data using data region. For eg. the first level will be a list of customer names. The second level will be a list of Invoices under each customer. The third level will be a list of product names that were sold under each invoice.



I used a list for the data region and in each hireachy, there is a textbox in each list to display the data. I am trying to associate each data region with a datatable (I will provide the logic to populate the datatable with appropiate data). I do not want the ReportViewer to interact directly with a database because this is a 3 tier design and I am using the ReportViewer in local mode. I couldn't find any example of these. Can anybody help? Also I would like to see an example of the .rdlc file in these situation. Thanks very much.





Kam

View 4 Replies View Related

Display Any Database On The Web

Mar 6, 2006

Hello. I've been searching for a couple of hours online and can't quite seem to find what I'm looking for. I've found plenty of database administration programs, but that's not what I need.

I'm looking for a program (or online service or whatever) that has the ability to basically take any database I choose and display the information within on a web page in which others can access. Such as, if my company wants to take on a few other company's databases and have them log in to our server through the web to display information from their (and only their) database dynamically on the web, then this program allows me to set all of that up. Information could be formatted in tables, charts, etc., whatever the program is capable of. Is there such a thing and where can I find more information?

Thanks for everyone's help. :-)

View 14 Replies View Related

Display TABLE_NAME From Database

Dec 19, 2006

Hi, I would like to display the TABLE_NAME variable where the table.ID =@IDSo far I got here:   SELECT TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE (TABLE_TYPE = 'BASE TABLE') AND (TABLE_NAME.ID = @ID)  but the last part AND (TABLE_NAME.ID = @ID) does not work. Thanks, dg 

View 10 Replies View Related

Database Display/manipulation

May 24, 2007

I have a web page called homepage.aspx created in Visual Studio 2005 using VB. It contains some hyperlinks on the left side. I have a database created in SQL Server 2005. I need to add, delete, edit, update data in the database directly from this same page. How can I achieve this?. i.e is it possible to, say, have a form on a section of this same web page that would allow me to directly manipulate/modify and update the database? (If you may give code, you may use abstract names for the database, tables and column and/or field names-I will understand). Many thanks in advance.

View 3 Replies View Related

Extract XML From DataBase And Display It

May 21, 2008

Hi,

How can I extract an XML from my data base and display it on reporting services?
I want to make a list of team (it's already do) and a link to a report wich display the XML

But I don't know how can I display this XML into a table.

Database Design:
[Table=FootTeam]
_ id : bigint
_ nameTeam : nvarchar
_ playerInfo : xml

DataBase Table
1 | "Mancherter" | "<team><player><name>Mick All</name><postion>Defense</postion></player><player><name>Pete Kolo</name><postion>Atack</postion></player></team>"
2 | "Liverpool" | "<team><player><name>John Back</name><postion>Defense</postion></player><player><name>Alex Pol</name><postion>Atack</postion></player></team>"


Example of a XML:
<team>

<player>

<name>Mick All</name>
<postion>Defense</postion>
</player>
<player>

<name>Pete Kolo</name>
<postion>Atack</postion>
</player>
</team>

View 2 Replies View Related

Display Data Without Binding

May 26, 2006

Hi All
I am new to VS 2005 and ASP.NET. I used to use Dreamweaver to design but now I am trying VS.
What I want to do is to display data retrieved with a SqlDataSource in a web page. I know how to do it by binding it to the various controls (Grid, DataList, DetailsView, FormView, Repeater.) available but how can I display it without using any of the mentioned (Grid, DataList, DetailsView, FormView, Repeater)?
Any help apprecited.

View 1 Replies View Related

How Do Not Display Data With FETCH NEXT FROM

Apr 2, 2001

Hi,
I have stored procedure with cursor
I have to use following
step 1 fetch RateValidDates into @Id_RateCode, @TheValidDate
.... get data

step 2 fetch prior from RateValidDates
... condition

step 3 fetch NEXT FROM RateValidDates into @Id_RateCode, @TheValidDate
... go to next record

Sql query analyzer output result of fetch NEXT FROM on the screen
What seeting should i use to avoid output on screen
(The reason My cursor takes about 8000 - 10000 rows when it's open)

View 1 Replies View Related

Cannot Display The Data In My Tables.

Dec 22, 1999

When I select a table and try to view the data I take the return all rows or return top option. However nothing is displayed. These options worked before and I don't understand why it's not working now. Can anyone help?

View 1 Replies View Related

Text And Sum Display Data

Jan 28, 2015

I want to output this result. how to write this query? "This is new amount 1000" select "This is new amount "+@sum(amt) as amount from table

View 2 Replies View Related

Change Data Display

Sep 28, 2005

I have a db; that stores a company name; if the end user types in
The Stoneware Jar Company

I would like to display:
Stoneware Jar Company

All company names entered like that with no preceding "The"

How can I display something diff on my ASP Page? Possible?

View 20 Replies View Related

Display Row Data As Cols

Jun 6, 2006

I have data in rows that I need to aggregate and display in a columnar fashion and I haven't been able to figure out how to do it. A simplified version of the data as it is stored in the table:

Station Month Day Reading

1 1 1 100

1 1 2 200

1 1 3 300

1 2 1 400

1 2 2 500

And I would like to create a query that returns:

Station Month Day 1 Day 2 Day 3

1 1 100 200 300

1 2 400 500

Any help you can provide or tips to steer me in the right direction are much appreciated.

Dianne Siebold

View 6 Replies View Related

Data Display In Table

Apr 4, 2007

Hi,

I have a result set from a store procedure which looks like this.



Column1 Column2 Column3

A 1 lit1

A 1 Rep2

A 1 Reg3

B 2 ram1

B 2 lim2



I want to show data in my table like this:



Column1 Column2 Column3

A 1 lit1; Rep2;Reg3

B 2 ram1;lim2



Can anyone tell me how I can do this?



Thanks

Ashwini

View 1 Replies View Related

Checking For No Data To Display

Oct 30, 2007

I am using a filter in a matrix control. I would like to display a "No data" type message if no data is present. The problem I'm running into is the base query is returning data, but the optional filter is removing all rows from display.

So using CountRows in the base dataset doesn't quite cut it. Is there an alternative?

View 4 Replies View Related

Matrix - No Data Display NaN

May 6, 2007

Hello,



I have matrix object in reportin (SQL 2005 reporting services)

When in some field have no data it display NaN.

How can I change it ?

I try to use iif(my function = nothing.....) but didn't help

View 1 Replies View Related

Table Display If No Data?

Jan 6, 2008

I have a fairly complicated report consisting of numerous datasets and numerous tables.

In one of my tables I want to display the message "No data to display" if nothing comes back from the query. Currrently the table just disappears if there is no data. Is there a way to display the table if there is nothing in the query?

View 4 Replies View Related

Duplicated Data Display

Mar 5, 2006

Hi all. i have the following function below,which use to retrieve the order detail from 2 table which are order detail and product. i have many duplicated order id in order detail, and each order id has a unique product id which link to product to display the product information. however when i run the following function below . its duplicated each product info and dsplay in the combo box. May i know whats wrong with my code?

    Public Sub ProductShow()

        Dim myReader As SqlCeDataReader
        Dim mySqlCommand As SqlCeCommand
        Dim myCommandBehavior As New CommandBehavior
        Try
            connLocal.Open()
            mySqlCommand = New SqlCeCommand
            mySqlCommand = connLocal.CreateCommand
            mySqlCommand.CommandText = "SELECT * FROM Product P,orders O,orderdetail OD WHERE  OD.O_Id='" & [Global].O_Id & "' AND P.P_Id=OD.P_Id "
                      myCommandBehavior = CommandBehavior.CloseConnection
            myReader = mySqlCommand.ExecuteReader(myCommandBehavior)
            While (myReader.Read())
                cboProductPurchased.Items.Add(myReader("P_Name").ToString())
            End While
            myReader.Close()
        Catch ex As Exception
            MsgBox(ex.ToString)
        Finally
            connLocal.Close()
        End Try

    End Sub

 

View 1 Replies View Related

Search Database And Display In Gridview

Feb 23, 2008

I'm trying to do a search but it seems like it couldnt get the text in my text book and run the command. Can anyone help me here?Function searchBook(ByVal booking_id As Integer) As System.Data.DataSet
Dim search As Integer = txtSearch.Text
Dim connectionString As String = "server='(local)'; trusted_connection=true; database='Speedo'"Dim dbConnection As System.Data.IDbConnection = New System.Data.SqlClient.SqlConnection(connectionString)
Dim queryString As String = "SELECT [booking].* FROM [booking] WHERE [booking].[booking_id] LIKE '%1%'"Dim dbCommand As System.Data.IDbCommand = New System.Data.SqlClient.SqlCommand
dbCommand.CommandText = queryString
dbCommand.Connection = dbConnectionDim dbParam_booking_id As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_booking_id.ParameterName = "@booking_id"
dbParam_booking_id.Value = booking_id
dbParam_booking_id.DbType = System.Data.DbType.Int32
dbCommand.Parameters.Add(dbParam_booking_id)Dim dataAdapter As System.Data.IDbDataAdapter = New System.Data.SqlClient.SqlDataAdapter
dataAdapter.SelectCommand = dbCommandDim dataSet As System.Data.DataSet = New System.Data.DataSet
dataAdapter.Fill(dataSet)Return dataSet
End Function
 Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearch.Click
' If Not Page.IsPostBack Then
'Dim search As String = txtSearch.Text
'MsgBox(search)
If ddSearchCat.SelectedValue = "booking" ThenMsgBox("you have selected booking")
GVSearch.DataSource = searchBook(txtSearch.Text)
GVSearch.DataBind()
ElseIf ddSearchCat.SelectedValue = "Log" ThenMsgBox("you have selected Log")
GVSearch.DataSource = searchLog(txtSearch.Text)
GVSearch.DataBind()
ElseIf ddSearchCat.SelectedValue = "UserName" ThenMsgBox("you have selected UserName")
GVSearch.DataSource = searchUserName(txtSearch.Text)MsgBox("HELLO IN GRID")
GVSearch.DataBind()
GVSearch.Visible = TrueMsgBox("out of grid")
End If
'End If
End Sub

View 3 Replies View Related

I Have A Pdf File In The Database That I Want To Display In A Browser

Sep 28, 2004

I have the following sql that retrieves the file from the database:

SqlConnection connection = new SqlConnection (ConnectionString);
SqlCommand command = new SqlCommand ("get_document", connection);
command.CommandType = CommandType.StoredProcedure;

What do I need to do to actually display this pdf file?

View 1 Replies View Related

How To Display All The Database Using Osql Utility

Oct 13, 2006

I am using the osql utility to access my sql server express edition.

My problem is that i don't know how many database is in the sql server so can any teach me how to list out all the name of the database in the sql server using a sql statment?

Oh, and can anyone teach me how i can attach and detach a database in the sql server using sql statment.

Thanks for the help...

View 3 Replies View Related

Display In Report Which Database You Are Running From

Apr 11, 2008

Hi,

I searched in the previous posting but can't find any or miss them. We have a few databases that users can run reports from, i.e. production, training & development. Is there any way, say put it in either in the header or footer, to display from which database that the report are running from? Sometimes they got confused whether the data is current or like few days old.

Any input is very much appreciated. Thanks in advance ..

View 5 Replies View Related

Display 1 Piece Of Data From A SQLDataSource

Jul 23, 2007

I have the following sqlDataSource. I wan't to display one piece of data, not a whole row, from it. I can find lots of information on putting it into a datagrid, but nothing on puttin one piece in a textbox. I cannot use a formview as we are embedding html in  response.write and it breaks in a formview. Thanks. 
 
<asp:SqlDataSource runat="server"
             ID="myEmpInfo"
SelectCommand="Select di.EmpInfo,di.eth,gc.t_level         From tblEmp di
        ,tblMisc gc
Where di.empnum = @empnumand di.empnum = gc.empnum" DataSourceMode="DataReader" ConnectionString="<%$ ConnectionStrings : myConnectionString %>">
 
<SelectParameters>
<asp:QueryStringParameter Name="empnum" QueryStringField="empnum"/>
</SelectParameters>
 
</asp:SqlDataSource>

View 1 Replies View Related

Display Of Data Category Wise

Dec 12, 2007

Hi, 
  I have a requirement where I need to display the items category wise   
I have 3 tables, 
one stores category_id, parent_id and category_name 
second table stored item_id,item_name and proce 
3rd table stores category_id and item_id   
I need to display the values like this   
Category name, Item name   
with first parent category ans ites items should be displayed and next sub category and its item   
By category table with contain 2 levels of sub category 
i.e Category1 
       Category11 
        Category111 
any help with the query would be much appreciated, I wrote the query something like this.... 
select c.category_name,parent_id,item_name from category c,items i,Category_item ci where
ci.item_id=i.item_id and c.category_id=ci.category_id order by parent_id, category_nameBut  it will display all parent category items then the sub category items I want to display like thiscategory1 items1category11 item11category1 item12category11 item111category11 item112 category2 item2 
Thanks
 

View 2 Replies View Related

Display Data In A Gridview In A Little Diiferent Way

Apr 25, 2008

Good Day, Please help me, I have a database that looks like this, Building No.        Floor No.        Room No.        Customer Name            Appliances          Appliances Codea                        1                    01                    John                            TV                    12a                        1                    02                             //up tob                        20                  10                    james                       Ref.                       22b                        20                  10                    joe                           Microwave             15 //and soon so if you would notice some rooms are vacant, as it usually happens, the buildings, floors and rooms are fixed except for the customers and the appliances. so at first i made this gridview and display this data in this manner:Customer Location (Building + floor)           total rooms         Used Rooms         Available rooms       A1                                                             2                  1                              1       B2010                                                        2                  2                              0 so if you would look at the table above, it just SUM up all tenants in a specific Location then Group it by Customer location,but i need to add the appliances in a different format like this: Customer Location (Building + floor)           total rooms         Used Rooms         Available rooms            TV         Ref            Microwave
       A1                                                       
     2                  1                              1                         tick
       B2010                                                  
     2                  2                              0                                       tick               tick so this is what i need to show, i already have done the first table (w'o appliances) but how can i make this second table?? please help me, SALAMAT PO.,Thanks  

View 3 Replies View Related

Display Data By Moving Nulls

Dec 5, 2006

Hi!

I have data in the following manner:

period course1 course2
4 NULL Eng
4 NULL Math
4 Phys NULL
4 Chem NULL

Is there any way I can show this data this way (the order is irrelevant - row1 can be joined with row3 or row4)?
period course1 course2
4 Phys Eng
4 Chem Math
4 Phys Eng
4 Chem Math

Basically, I want to be able to remove nulls.

Please let me know if any of you have come across such an issue.

Thanks so much!

-Parul

View 3 Replies View Related

Don't Want To Display Sensitive Data In Columns

Oct 21, 2014

I have a table. I have some sensitive data that I don't want to display that sensitive data. The columns I want to abstract are

Firstname varchar(50) not null
Latname varchar(50) not null
dob datetime not null
addressline1 varchar(50) null
adressline2 varchar(50) null
city varchar(50) null
postalcode varchar(20) null

I want to display null values as nulls empty as empty not null as numbers.

View 4 Replies View Related







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