.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

fetch data from cursor(what wrong?)

Posted By:      Posted Date: September 01, 2010    Points: 0   Category :ASP.Net
hi there i have a SP that send mailbut in the cursor does not appears no one record, i written PRINT'-------' , and it seems no recordwhere is wrong here?the query returns 200 records here, but not in cursoralter PROCEDURE [dbo].MAIL (@date date) AS BEGIN declare @MonthlyTimeInterval int declare @WorkingDaysBeforeOpen int declare @WorkingDaysBeforeClose int ----valorizzazione parametri MAIL--------- select @MonthlyTimeInterval=MonthlyTimeInterval, @WorkingDaysBeforeOpen=WorkingDaysBeforeOpen, @WorkingDaysBeforeClose=WorkingDaysBeforeClose FROM ParameterData --------market in apertura------------- DECLARE @getMktOpen CURSOR declare @PeriodEND date declare @PeriodStart date declare @Market Varchar(300) declare @Status bit declare @MarketID int DECLARE @MarketPeriodID INT SET @getMktOpen = CURSOR FOR SELECT MAX(Period.[Desc]) AS PeriodEND, MIN(Period.[Desc]) AS PeriodStart, Market.[Desc] AS Market, MarketPeriod.Status, Market.MarketID, MarketPeriod.MarketPeriodID FROM MarketPeriod INNER JOIN Period ON MarketPeriod.PeriodID = Period.PeriodID INNER JOIN Market ON MarketPeriod.MarketID = Market.MarketID GROUP BY Market.[Desc], MarketPeriod.Status, Market.MarketID, MarketPeriod.MarketPeriodID -- HAVING (MarketPeriod.Status = 0) -- AND (MIN(Period.[Desc]) = CONVERT(CHAR(11),@date,111) ) OPE

View Complete Post

More Related Resource Links

How to fetch data from textbox dynamically in a gridview

How to fetch data from textbox inside a gridview

Getting "wrong" data out of a microsoft.sqlserver.management.smo.database object property (using pow

My problem:I do something like this:$dbsvr = new-object microsoft.sqlserver.management.smo.server "servername"$dbsvr.databases | ft name,size -autosizeWhen i run this from two different PC's i get database sizes that are all the same (5.25 mb), the size of the first database listed - which is master.I started to try out a few things, and found out that when i run the same command from one of our servers it returns the correct sizes...Anyone have any idea if this a SMO issue, or maybe some package software version issue...- or what?

Data Binding a DataGrid to a list fetch the same data multiple times

Hi, I'm using DataGrid to show data through data binding. My data are provided in a list. The setup I have is the following: DataGrid "binded" to the default view of my list that implement IList<T> and IList interfaces (MyList<T> : IList<T>, IList, INotifyCollectionChanged)             CollectionViewSource.GetDefaultView(_myList);             // Set the data context             DataContext = view; T: is here my 'business object' that hold the data, called 'MyRow'. Then the columns of the DataGrid are bound to public properties of 'MyRow' object. MyRow class has a public property of type 'object' (public object data[int index]) and first column of datagrid is bound to myRow.data[0], second column is bound to myRow.data[1] and so on.   When the datagrid is displayed, databinding kick in and my data are showed in the control. The issue I'm having is that data fetching is very repetitive even for the same rows. For example for a datagrid with 20 visible rows, the first row is fetched multiple times even if the datagrid is not resized or moved. I put break point inside my list (MyList<T> into This[T] property (public T this[int index]) and i got multiple hits into the property for the same index. Fetc

Data from text files, What's wrong with my code?

Hi all, I have uploaded some tab-delimited .txt files on my web site (actually run on my computer, ie localhost, for now), and now I try to retrieve the data from those files. I do this by calling a vb file containg the sub below. Everything works great, except that the sub won't recognise unicode characters. I can split the resulting string using vbnewline and vbtab, but already in the sub in question, the string doesn't understand the Swedish letters åäö, apostrophes and more. Any help would be greatly appreciated! /Pettrer       Shared Function getTextfile(ByVal FullPath As String, Optional ByRef ErrInfo As String = "") As String Dim strContents As String = "" Dim objReader As StreamReader Try objReader =New StreamReader(FullPath) 'UTF8Encoding? strContents = objReader.ReadToEnd() objReader.Close() ErrInfo = Ex.MessageCatch Ex As Exception End Try Return strContents End Function  

Infopath 2007: Cant we fetch data from a list or form library without using a Query to the data conn

I am trying to fetch data from a form library and a list (both secondary data sources). But cant do it without using a rule (Query using a data connection). However when I use the 'Refresh' control on the form it brings the value. I find it quite weird, as the connections are made properly and logically speaking all the data connetions should fetch dynamic data once the form opens or loads. Cant we do it without using a (data query) rule? Update: I am using a web based infopath forms, while using the same form on client its working fine. Why is that?

How Fetch Data from HTML tags

Aslam o alaikum to allI am working in asp.net and vb.net i want to get data from <p>Dta to get in vb code</p> this and from a table like<table><tr><td>ID</td><td>Name</td><td>1</td><td>Saleem</td></tr><table>please help me thanks and best regards

Fetch data from one list and populate another list


How to fetch the details from one list & show it in an another list in Sharepoint 2010.


List #1 : Total Project/Resource List

   Resources       Projects
         Resource1 Project1,project2
  REsource2 Project1,project3

List #2 : Resources Per project


How to fetch details from List1 based on projects (Projects (Multiline text) are comma seperted data)


Fetch data from JDEdwards


Dear Friends,

I want to fetch data from JDEdwards and put it in Microsoft Sql Server 2005, how it is possible ?, please describe it.



How to fetch data from nested gridview


Hi, Please guide me how to fetch data from Nested gridview checkbox on Click button event which is present outside the gridview. I did try by creating an object of child gridview on button1_click but cannot fill the value from Gridview2 into my int i. Below mentioned is the Code i am using. The database I am using is Oracle.

 ==== Code =====

 protected void Button1_Click(object sender, EventArgs e)


OracleConnection con = new OracleConnection();

        con.ConnectionString = ConfigurationSettings.AppSettings["oracle"];

        //int RowIndex = Convert.ToInt32(e.CommandArgument);


        //GridView subGrid = (GridView)GridView1.Rows[RowIndex].FindControl("GridView2");


        //GridView subGrid = (GridView)GridView1.FindControl("GridView2");

        int i = 0;

        GridView subGrid =((GridView)GridView1.Rows[i].FindControl("GridView2"));


After adding filter, data fetch limit error


Alright, so i'm getting the "this page has exceeded its data fetch limit for connected web parts" error.
But it only happens if i add a filter.

Currently I have 6 lists on the page and am using 4 filters, so why can't I add a 5th filter?

Forgot to mention that I added the filters with SharePoint designer 2007

Cannot Fetch Data via SQLFetch Function (ODBC Programming)


Hello Everyone

I'm c# developer but i want use c++ for the future times.  I'm newly in ODBC Native programming. I wrote this code and compiled successful but i can't get customerIds. Because i get an error its "[Microsoft][ODBC Driver Manager] Invalid descriptor index" here is my code

#include <Windows.h>

#include <sql.h>

#include <sqltypes.h>

#include <sqlext.h>

#include <stdio.h>

int main()






	SQLWCHAR	*szDns = L"Driver={SQL Server};Server=.\\SQLEXPRESS;Database=TestForQt;Trusted_Connection=Yes;";


	int			columnValue;

	rc = SQLAllocEnv(&hEnv);


	rc = SQLAllocConnect(hEnv, &hDbc);


	rc = SQLAllocStmt(hDbc, &hStm);

	rc = SQLExecDirect(hStm, L"SELECT customerId FROM customer", SQL_NTS);

	while(SQLFetch(hStm) == SQL_SUCCESS)


Exporting data that is in wrong code page in SQL Server



I have problem, when tryin to export data from SQL Server 2005 using Integration Services.

Sql Server has collation SQL_Latin1_General_CP1_CI_AS (code page 1252), but the actual data is encoded using code page 1257 (SQL_Latin1_General_CP1257_CI_AS). When I look the data using Management Studio, it is displayed wrongly, but when I convert the string to binary, I can see that bytes are encoded using code page 1257. I'm trying to read this data using SSIS 2005, but extended characters are always handled wrongly.

How should I read this data using SSIS?

My first assumption was changing DefaultCodePage to 1257 in my OLE DB Source component (also AlwaysUseDefaultCodePage to true). But without luck.

Also tried to convert data in my SQL Server query using COLLATE, but didn't work.

Is there something I could do to get it working?



Accordion inside Gridview, fetch gridview data when expanding accordion


using asp.net/vb.net 2005

I want to create an accordion inside a gridview with the following functionality:

The user will only see one field of the gridview initially, the ProductCategoryID.  When the page loads it will only query the ProductCategoryID and this will be the only field displayed.

Next when the user clicks on the accordion to expand it inside the gridview I would like to query the database to get all Products that are part of the ProductCategory.  I will query using the ProductCategoryID that is being displayed.

I need to do this for performance issues.  The main thing I am looking for is how to query the database once the user expands a given ProductCategoryID.

but now I think of it one thing I need to know:  when you bind an accordion to a dataset will it create one pane for each record returned?  It might be better to put the gridview inside the accordion.  I'm willing to do either, as long as it works



Listview changes on edit but selects the wrong data for editing


i have a listview and a sqldatesource with a search paramater and a dropdown list to select a catagory for search and a textbox to get the term for the search 

so i can select a category from the dropdown menu and enter the search term and the search will be displayed but when i got to edit the record it goes back to begining of the dataset so it will resert the search field. but if the listview is already on edit mode and i do a search i am able to get a search result and edit the data. 

So i want to be able to run the search and edit the result only. 

here is my page code and the code behind which is in vb 

<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site1.Master" CodeBehind="SearchEditJobs.aspx.vb" Inherits="NEWWEBPAGE.SearchEditJobs" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

showing Wrong Data while loading excel sheet, need help urgent



I am trying to load data from an excel sheet to a table in sql server. in the excel-source when i press preview button data for one column in the excel sheet is coming as null. the column has numbers and the format of the cell is 'general'..? what could be wrong and how could i resolve.? need help urgently..?

Fetch data from the database and place it in a marquee

The article Fetch data from the database and place it in a marquee was added by codenickel on Saturday, October 30, 2010.

1. First we should take the marquee tag in the source of our web form(Page.aspx) page like this:->marquee direction="up" onmouseover="this.start()" onmouseout="this.stop()"scrolldelay="300? style="height: 213px">asp:Literal ID="lt1? runat="server

Not able to fetch data for Application Domains related to .NET Framework 4.0 Process


We want to enumerate all .NET Framework 4.0 Processes on a particular machine. And then want to enumerate Application Domains for those processes.

After enumerating Application Domains, we want to fetch data about each Application Domain using following APIs.




We tried this using ICorPublishAppDomain Interface as well as following code :

ICLRMetaHost *meta; 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend