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


ADVERTISEMENT

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

Data Fetch

Sep 5, 2007

Hello..
i develope a web projects of horoscope or astrology(http://demo.reallianzbussimart.com/allzodiac.aspx), there is an 12 Zodiaz sign and all the data call on this page through the Database , in this page i there is an one sql query ----                                                                                                                (Select Top 1 col from colour order by newid(),Select Top 1 num from number order by newid() ,Select Top 1 days from day order by newid()  )
then all data call one by one change ..
when the refresh the page the value of all zodiac is change that is wrong ,,,
so what is the quary that one time in day the value off all zodiac is same next day the value  has been change............................................
 
so please help me /...........
tell what is the process to not data change into the page refresh
Ashwnai 
 
 
 

View 4 Replies View Related

Data Fetch

Apr 13, 2007

Hi,



I'm using a remote SQL Server Express database with a C# app, and to do so as most of you already know, there's no DataSource available, it's all around SQL. This poses a problem as when I want to browse (1 by 1 in my app, with search utility) the contents of a given table, I have to perform a Select command. Well the problem is when I do this it loads all records into a DataSet (or DataTable), which is fine by me, but one of my tables is expected to reach 400 or 500 records in a few months time. This will mean a lot of loading from the db once the app is launched. Is there a way to make this connection more efective? Thanks

View 1 Replies View Related

Fetch Data From Sqldatasource

Jun 4, 2008

hi,im just a newbie in asp.net.i have my sqldatasource and a label. i want to get the data from sqldatasource to the label. how can i do that.need codes 

View 2 Replies View Related

Fetch Data From Hierarchy In XML.

Oct 11, 2007

My problem is that my:hustyp)[1] only fetches the first occurace of this tag. In my xmlfile this field is a repeating table created in infopath 2007. How do I manage to get the rest dynamically.

------XML-file---------------------------------------
<my:group1>
<my:group2>
<my:hustypTF>5</my:hustypTF>
</my:group2>
<my:group2>
<my:hustypTF>6</my:hustypTF>
</my:group2>
<my:group2>
<my:hustypTF>7</my:hustypTF>
</my:group2>
</my:group1>
-----------------------------------------------------

------T-SQL for fetching data from XML datatype------
WITH xmlnamespaces('http://schemas.microsoft.com/office/infopath/2003/myXSD/2007-01-15T13:29:33' AS my)
SELECT FormData.value('(/my:xxx/my:Formular/my:group1/my:group2/my:hustyp)[1]', 'varchar(99)') AS IdFastBet
FROM MinaDekl
CROSS APPLY FormData.nodes('(/my:xxx/my:Formular/my:group1/my:group2/my:hustyp) as TempTab(testTab1)
-----------------

View 2 Replies View Related

Query To Fetch Data

Jul 23, 2005

Hi,I have a table with two columns Task and Employee. It lists all thetasks and the assigned employees. The same task will have multipleroles with an employeename or 'manager' as the data.If I have the following data'sales', 'john''sales', 'manager''dev', 'manager''make_coffee', 'manager''browse', 'jane''browse', 'manager'I need to get the rows wherever an employee is named (sales and browsefor example) and get manager for the rest.I can make it in two queries. Look for not manager in one and then formanager. Is there anyway to get them in a single query?If I need to look for 'sales', I need to get 'john' and not 'manager'.How to do that in a single query?Another need is to list all tasks with assigned. So for the above, Ishould get the following list'sales', 'john''dev', 'manager''make_coffee', 'manager''browse', 'jane'with two queries, I will get'sales', 'john''browse', 'jane''dev', 'manager''make_coffee', 'manager'which is ok. Order/sequence is not important.TIA,Sreelatha

View 2 Replies View Related

How To Fetch Unicode Data Using C++?

May 22, 2007

I am getting problem in fetching data from SQL using C++ program.
How to Fetch SQL Unicode characters?
I am using ODBC driver calls in C++ to fetch SQL data.
It is working fine with character data.
But for Unicode data it displays €œ????€? instead of data.

I am using SQL Server SQLSRV32.DLL for creating datasource.



Following is my code:

#include <windows.h>
#include <sqlext.h>
#include<srv.h>
#include<stdio.h>
#include <iostream.h>
#include <string.h>


int main(void)

{
void print_err2(RETCODE rc, SQLINTEGER type, SQLHANDLE handle);


HENV hEnv = NULL; // Env Handle from SQLAllocEnv()
HDBC hDBC = NULL; // Connection handle
HSTMT hStmt = NULL;// Statement handle
//UCHAR szDSN[SQL_MAX_DSN_LENGTH] = "myDataSource";// Data Source Name buffer
USHORT *szDSN;
szDSN = (USHORT *) malloc (sizeof(USHORT) * 13);
szDSN= (unsigned short *)"myDataSource";
//UCHAR szUID[10] = "sa";// User ID buffer
USHORT *szUID;
szUID= (unsigned short *) "sa";
//UCHAR szPasswd[10] = "bmcAdm1n";// Password buffer
USHORT *szPasswd;
szPasswd= (unsigned short *) "bmcAdm1n";
char buff[9] = "Testing";
// UCHAR szSqlStr[128]= "INSERT into Quali (Colname) Values ('Testing')" ;
//UCHAR szSqlStr[150]= "select name ,default_database_name,default_language_name from sys.sql_logins" ;
USHORT *szSqlStr;
szSqlStr = (USHORT *) malloc (sizeof(USHORT) * 150);
szSqlStr= (unsigned short *) "select name ,default_database_name,default_language_name from sys.sql_logins" ;
RETCODE retcode;


//UCHAR sqlState; // buffer to store SQLSTATE
// UCHAR errMsg[256]; //buffer to store error message
// SWORD count;



USHORT *sqlState;
USHORT *errMsg;
sqlState= (USHORT *) malloc(sizeof(USHORT)*6);
errMsg= (USHORT *) malloc(sizeof(USHORT)*256);
SDWORD retcode3=NULL; // return code
SDWORD nativeErr; // native error code
SWORD realMsgLen; // real length of error message


// sprintf((char*)szSqlStr,"select name ,default_database_name,default_language_name from sys.sql_logins",buff);


// Allocate memory for ODBC Environment handle
cout<<"hEnv before SQLAllocEnv = "<<hEnv<<endl;
retcode= SQLAllocEnv (&hEnv);
cout<<"retcode= "<<retcode<<endl;
cout<<"hEnv after SQLAllocEnv = "<<hEnv<<endl;
cout<<"***********************";



// Allocate memory for the connection handle
cout<<"hDBC before SQLAllocConnect = "<<hDBC<<endl;
retcode= SQLAllocConnect (hEnv, &hDBC);
cout<<"retcode= "<<retcode<<endl;
cout<<"hDBC after SQLAllocConnect = "<<hDBC<<endl;

cout<<"***********************";




SQLAllocHandle(SQL_HANDLE_DBC, hEnv, &hDBC);





// Connect to the data source using userid and password.

retcode = SQLConnect (hDBC, szDSN, SQL_NTS,szUID, SQL_NTS, szPasswd, SQL_NTS);
cout<<"retcode= "<<retcode<<endl;

if (retcode != SQL_SUCCESS )
{
retcode3 = SQLError(SQL_NULL_HDBC, hDBC, SQL_NULL_HSTMT, sqlState,&nativeErr,errMsg, 256, &realMsgLen);
// print_err(sqlState, nativeErr, errMsg, realMsgLen);
//print_err2(retcode,SQL_HANDLE_DBC,hDBC);
cout<<sqlState<<endl<<nativeErr<<endl<<errMsg<<endl<<realMsgLen;
}


if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO)

{
cout<<"Connection established....!";


// Allocate memory for the statement handle
cout<<"hStmt before SQLAllocStmt = "<<hStmt<<endl;
retcode = SQLAllocStmt (hDBC, &hStmt);
cout<<"retcode= "<<retcode<<endl;
cout<<"hStmt after SQLAllocStmt = "<<hStmt<<endl;
cout<<"***********************";

/*
// Prepare the SQL statement by assigning it to the statement handle
retcode = SQLPrepare (hStmt, szSqlStr, sizeof (szSqlStr));

cout<<"Statement szSqlStr: "<<szSqlStr<<endl;
cout<<"Statement hStmt: "<<hStmt<<endl;
// Execute the SQL statement handle

retcode = SQLExecute (hStmt);
*/

retcode = SQLExecDirect(hStmt,szSqlStr, SQL_NTS);

UCHAR name[4000],defDBnm[4000],defLanguage[4000];
SDWORD retcode2, cbname, cbdefDBnm, cbdefLanguage;

retcode2=NULL;

if (retcode2 == SQL_SUCCESS)
{
retcode2 = SQLBindCol(hStmt, 1, SQL_C_CHAR, name, 4000, &cbname);
retcode2 = SQLBindCol(hStmt, 2, SQL_C_CHAR, defDBnm, 4000, &cbdefDBnm);
retcode2 = SQLBindCol(hStmt, 3, SQL_C_CHAR, defLanguage, 4000, &cbdefLanguage);
}







if (retcode2 != SQL_SUCCESS) /* warning or error returned */
{

retcode3 = SQLError(SQL_NULL_HDBC, hDBC, SQL_NULL_HSTMT, sqlState,&nativeErr,errMsg, 256, &realMsgLen);
//print_err(sqlState, nativeErr, errMsg, realMsgLen);
cout<<sqlState<<endl<<nativeErr<<endl<<errMsg<<endl<<realMsgLen;
}




cout <<"****************************************";
while (TRUE)
{
retcode2 = SQLFetch(hStmt);

if (retcode2 == SQL_SUCCESS || retcode2 == SQL_SUCCESS_WITH_INFO)
{
if (cbname == SQL_NULL_DATA) /* check null data */
printf("name: NULL");
else
printf("Name: %s", name);

if (cbdefDBnm == SQL_NULL_DATA)
printf("defDBnm name: NULL");
else
printf("defDBnm name: %s", defDBnm);

if (cbdefLanguage == SQL_NULL_DATA)
printf("defLanguage: NULL");
else
printf("defLanguage : %s", defLanguage);
}

else if (retcode2 == SQL_ERROR ) /* warning or error returned */
{

retcode3 = SQLError(SQL_NULL_HDBC, hDBC, SQL_NULL_HSTMT, sqlState,&nativeErr, errMsg, 256, &realMsgLen);
//print_err(sqlState, nativeErr, errMsg, realMsgLen);
cout<<sqlState<<endl<<nativeErr<<endl<<errMsg<<endl<<realMsgLen;
}

else /* if no more data or errors returned */
break;
}


// Project only column 1 which is the models
// SQLBindCol (hStmt, 1, SQL_C_CHAR, szModel, sizeof(szModel), &cbModel);


// Get row of data from the result set defined above in the statement

// retcode = SQLFetch (hStmt);


// Free the allocated statement handle
SQLFreeStmt (hStmt, SQL_DROP);

// Disconnect from datasource
SQLDisconnect (hDBC);
}

// Free the allocated connection handle
SQLFreeConnect (hDBC);

// Free the allocated ODBC environment handle
SQLFreeEnv (hEnv);

return 0;
}

void print_err2(RETCODE rc, SQLINTEGER type, SQLHANDLE handle)
{
//SQLCHAR SqlState, *sq = &SqlState[0];
SQLUSMALLINT *SqlState;
SqlState=(SQLUSMALLINT *) malloc (sizeof(SQLUSMALLINT)*6);
SQLUSMALLINT *sq = &SqlState[0];
SQLCHAR Msg[SQL_MAX_MESSAGE_LENGTH], *ms = &Msg[0];
SQLWCHAR SqlStateW, *sqw = &SqlStateW[0];
SQLWCHAR MsgW[SQL_MAX_MESSAGE_LENGTH], *msw = &MsgW[0];
SQLINTEGER NativeError;
SQLSMALLINT i=1, MsgLen;
RETCODE ret;
int j;

printf("Error number is %d", rc);
while (SQL_SUCCEEDED(SQLGetDiagRec(type, handle, i++,(unsigned short *) SqlState, &NativeError, (unsigned short *)Msg, sizeof(Msg), &MsgLen)) )
{
printf("State: %s Native Error Code: %d %s (%d)",
SqlState,NativeError,Msg, MsgLen);
}
}











Regards
Ketaki

View 3 Replies View Related

Fetch Data From XML Column To Table

Aug 29, 2007

I do an insert of the xml into the table and that works fine, but how do I split the tags to different tables. I have tried SSIS and a XML Source to an OLEDB Source, but since the xml file contains different groups that do not work.

The xml is created by Infopath and it seems like the groups are created if the components belongs to different sections.

Table1
id int,
xmltag xml

I am starting to be desperate, I really need some help solving this one way or another.

View 2 Replies View Related

Fetch Data Based On SQL Server Table

Mar 26, 2003

Hi,

I am using DTS (Data Pump Task) to fetch selective data from AS/400. The Selection is based on a table which is on SQL Server.

I can not fetch the whole data as data is huge & only want for particular items. How can I achieve this taks

Thanks
Shafiq
:confused:

View 6 Replies View Related

How To Fetch The Data Which Is Not The First Or Last Record From DB By Reporting Service?

Aug 6, 2007



I only found first or last function which means I can't show the data of others, is there any solution to solve this issue?

Thanks in advance.

View 4 Replies View Related

How To Fetch Data Before Inserting A New ROW If We Are Using Identity Column??????

Apr 21, 2008

Hi,

I am using SQL Server 2005 Mobile Edition & Merge Replication

in this I want to insert a record into table,
in that table I have taken UserID coloumn as auto incrementing Identity type.

In a book I read that,
If you are using an Identity column, you must find the next available number and reseed before an insert can be successful. You will also have to set up ranged identity columns on the published database to prevent errors when the new data is merged.

Now I want to ask here that, how should I ressed that value before inserting?????

any help in a form of CODe will be appriciated.....

thanks in advance...

View 8 Replies View Related

Integration Services :: Fetch Data From Second Sheet

Oct 31, 2015

I was working on a logic which I am not able to code after many attempts. I have an Excel sheet(Base_Data.xlsx) with two sheets as "Mapping" & "Data" with the below data:

Mapping sheet values:

Base_Column Data_Column
Employee Emp
Designation Desig
Organisation Org

Data sheet values:

Emp joindate Desig Gender Org
1234 10/10/2010 Consultant Male Microsoft
4546 25/01/2001 Sw engineer Female Pega

Now using the above base_Data file, I have a to prepare a destination Excel(Destination_File.xlsx) as below:

Employee Designation Organisation
1234 Consultant Microsoft
4546 Sw engineer Pega

I tried to achieve this using SSIS and C#.Net technologies.

View 3 Replies View Related

SQL Server Admin 2014 :: How To Fetch Data From Oracle Database

Oct 14, 2015

how to fetch data from oracle database in sql server 2014

example:

oracle schema :t1
sql server :t2

now am in t2 sql server database

now am executing below query

select * from t1.tablename ;

View 1 Replies View Related

Transact SQL :: How To Fetch Data Updated Today Irrelevant Of Timing

Apr 21, 2015

I need the rows updated today in catalogue table irrelevant of timing. I tried all the below queries.

select * from CATALOGUE where CAT_DATE=CONVERT(datetime, CONVERT(varchar, GETDATE(), 101))
select * from CATALOGUE where CAT_DATE= CONVERT(date, getdate())
select * from CATALOGUE where CAT_DATE= cast(GETDATE() as date)

I am getting output only if the information updated on 04/21/2015 00.00.00.000 but not for other timings, For example
04/21/2015 03.30.00.000, 04/21/2015 07.17.00.000 and all.

How can I retrieve all the records updated today.

View 4 Replies View Related

Fetch Data Of User Who Have Created Profile Within 7 Days - DateDiff Function

May 2, 2015

I have added one webpage designed in ASP.Net with C# and sql server 2005 as database. There is table for user registration in which there is a column for ProfileCreationDate the data type of that column is date time .

I would like to fetch data of those user who have created profile within 7 days. For getting desired result I am trying this query.

select Name ,Profession,ProfileCreationDate from tblRegistration where DATEDIFF ( Day , '" + System.DateTime.Now + "',ProfileCreationDate)<7 order by ProfileCreationDate DESC

System.DateTime.Now is a function for getting current date time in C#

The query is neither giving error nor giving desired result.

View 4 Replies View Related

SQL Server 2008 :: Write A Cursor To Fetch Required Data From Table?

Oct 21, 2015

I have been trying to write a cursor to fetch required data from table but somehow its running forever and inserting duplicate records.

I have a temp table named getInvoice where I have five important columns

1. invoice number
2.group
3.invoice status
4. Invoice Expiration date
5. Creation date time

and some other columns.One invoice number can belong to one or more group and there can be one or more records for a particular invoice number and group.

An example is below :

InvoiceNumber Group InvoiceStatus InvoiceExpirationDate CreationDateTime

579312 01 3 NULL 2003-03-24 00:00:00
579312 01 2 2015-12-14 00:00:00 2005-12-24 00:00:00
579312 02 2 2003-12-21 00:00:00 2005-10-12 00:00:00
321244 01 2 2015-12-21 00:00:00 2005-10-12 00:00:00
321244 01 3 2010-12-21 00:00:00 2010-12-21 00:00:00

My query condition is complex and that is why Im facing problem retrieving the output.I need a cursor for getting distinct invoice number from the table and for each invoice number I need to get the latest record for each invoice number and suffix combination based on creationdateand time column and if that record has invoice status of 2 and also the invoice expiration date can be either null or greater than today's date, then I need to get that record and put it in a temp table.

The query I wrote is below

declare myData cursor for
select distinct invoiceNumber from #getInvoice
declare @invoiceNumber varchar(30)
open myData
fetch next from myData into @invoiceNumber
while @@FETCH_STATUS = 0

[Code] .....

This query runs forever and doesn't stop.

View 6 Replies View Related

Data Access :: Bulk Fetch Records And Insert / Update Same In Other Table With Some Business Logic

Apr 21, 2015

I am currently working with C and SQL Server 2012. My requirement is to Bulk fetch the records and Insert/Update the same in the other table with some  business logic? How do i do this?

View 14 Replies View Related

Integration Services :: Fetch Data From Netezza Database Based On Values Present In Excel Using SSIS

Aug 7, 2015

I have an excel sheet containing one column (ID_NO) with 400K rows. I have a database from where I have to fetch some other columns from a Netezza database. Initially I tried hardcoding all the 400K rows in the query that I wrote using filter WHERE ID IN ('1212','2334'). But after pasting all the 400K rows the query is running indefinitely.

I have imported all the ID in a SQL table (MY_LIST table). I used a DFT, and selected ODBC source, and selected my netezza server. Then in the 'Data access mode' I selected the SQL command from the dropdown.I pasted the same query that I wrote in Netezza. Is there any way to pull only for those records that I have pulled in my SQL table (MY_LIST) ?

View 4 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 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 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

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

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







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