Wednesday, March 21, 2012
Data displayed in duplicates
If Session("ID") = 1 Or Session("ID") = 2 Then
select case (request.form("Individual"))
case "Individual" sql = "Select V_Monthreport.Q_ID,
V_Monthreport.Answer, V_Monthreport_Q.Question FROM V_Monthreport INNER
JOIN V_Monthreport_Q ON V_Monthreport.Q_ID = V_Monthreport_Q.QNo Where
V_Monthreport.PersID=" & session("Pers_ID") & " And
V_Monthreport.DeptID=" & request.form("SectID") & " And
V_Monthreport.Maand=" & request.form("Maand") & " And
V_Monthreport.Jaar=" & request.form("Jaar") & " Order By
V_Monthreport.Q_ID"
case "Section"
case "Summary"
end select
End If
<% while not rstMain.eof %>
<tr>
<td><font face="Tahoma" size="-2" color="Black"><%= rstMain("Q_ID")
%></font></td>
<td><font face="Tahoma" size="-2" color="Black"><%= rstMain("Question") %></font></td>
<td><font face="Tahoma" size="-2" color="Black"><%= rstMain("Answer") %></font></td>
</tr>
<% rstMain.movenext
wend%>
<% End If %>
I am experiencing a problem in that the data when displayed is
duplicated. The data in the db is not duplicated. So I dont have a clue
why the data is displayed in duplicates. Any comments on y?amatuer
How do you expect to get a right answer without posting some data to be
tested and an expected result.?
Take a look at DISTINCT , GROUP BY clause in the BOL
"amatuer" <njoosub@.gmail.com> wrote in message
news:1150881311.092232.176500@.y41g2000cwy.googlegroups.com...
> Code below:
> If Session("ID") = 1 Or Session("ID") = 2 Then
> select case (request.form("Individual"))
> case "Individual" sql = "Select V_Monthreport.Q_ID,
> V_Monthreport.Answer, V_Monthreport_Q.Question FROM V_Monthreport INNER
> JOIN V_Monthreport_Q ON V_Monthreport.Q_ID = V_Monthreport_Q.QNo Where
> V_Monthreport.PersID=" & session("Pers_ID") & " And
> V_Monthreport.DeptID=" & request.form("SectID") & " And
> V_Monthreport.Maand=" & request.form("Maand") & " And
> V_Monthreport.Jaar=" & request.form("Jaar") & " Order By
> V_Monthreport.Q_ID"
> case "Section"
> case "Summary"
> end select
> End If
> <% while not rstMain.eof %>
> <tr>
> <td><font face="Tahoma" size="-2" color="Black"><%= rstMain("Q_ID")
> %></font></td>
> <td><font face="Tahoma" size="-2" color="Black"><%=> rstMain("Question") %></font></td>
> <td><font face="Tahoma" size="-2" color="Black"><%=> rstMain("Answer") %></font></td>
> </tr>
> <% rstMain.movenext
> wend%>
> <% End If %>
> I am experiencing a problem in that the data when displayed is
> duplicated. The data in the db is not duplicated. So I dont have a clue
> why the data is displayed in duplicates. Any comments on y?
>|||here's the table:
CREATE TABLE [dbo].[V_Monthreport] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[PersID] [int] NULL ,
[DeptID] [int] NULL ,
[Datum] [datetime] NULL ,
[Maand] [int] NULL ,
[Jaar] [int] NULL ,
[Q_ID] [int] NULL ,
[Answer] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
CREATE TABLE [dbo].[V_Monthreport_Q] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[AfdelingID] [int] NULL ,
[Afdeling] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Seksie] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[QNo] [int] NULL ,
[Question] [nvarchar] (250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
& data looks like this:
V_Monthreport_Q:
14 1 Agricultural Service Agricultural Information Services 1 Marketing
of available new services of the Department (List Opportunities)
15 1 Agricultural Service Agricultural Information
Services 2 Opportunity/Involvement in identifying and development of
new clients; products; projects
16 1 Agricultural Service Agricultural Information
Services 3 Involvement in sustaining and improvement of the level of
expertise, as well as the knowledge and skills
17 1 Agricultural Service Agricultural Information Services 4 Intra
and inter-departmental co-operation (disposition/view)
18 1 Agricultural Service Agricultural Information
Services 5 Agricultural condition/State of Agriculture: Climate
(temperature, wind, etc)
19 1 Agricultural Service Agricultural Information
Services 6 Agricultural condition/State of Agriculture: Veld (coverage,
nutritional value)
20 1 Agricultural Service Agricultural Information
Services 7 Agricultural condition/State of Agriculture: Moisture status
21 1 Agricultural Service Agricultural Information
Services 8 Agricultural condition/State of Agriculture: Livestock
(conditions)
22 1 Agricultural Service Agricultural Information
Services 9 Agricultural condition/State of Agriculture: Commodity
prices
23 1 Agricultural Service Agricultural Information
Services 10 Agricultural condition/State of Agriculture: Labour
24 1 Agricultural Service Agricultural Information
Services 11 Agricultural condition/State of Agriculture: Security /
Safe keeping
25 1 Agricultural Service Agricultural Information Services 12 Client
Relations
26 1 Agricultural Service Agricultural Information Services 13 Threats
/ Concerns
V_Monthreport:
53 4 1 6/21/2006 6 2006 1 Test1
54 4 1 6/21/2006 6 2006 2 Test2
55 4 1 6/21/2006 6 2006 4 Test4
56 4 1 6/21/2006 6 2006 5 Test5
57 4 1 6/21/2006 6 2006 6 Test6
58 4 1 6/21/2006 6 2006 8 Test8
59 4 1 6/21/2006 6 2006 9 Test9
60 4 1 6/21/2006 6 2006 10 Test10
61 4 1 6/21/2006 6 2006 11 Test11
62 4 1 6/21/2006 6 2006 12 Test12
63 4 1 6/21/2006 6 2006 13 Test13
Sorry but this was the best i could.see if you cn help Uri
Dimant.thanx.
Uri Dimant wrote:
> amatuer
> How do you expect to get a right answer without posting some data to be
> tested and an expected result.?
> Take a look at DISTINCT , GROUP BY clause in the BOL
>
>
> "amatuer" <njoosub@.gmail.com> wrote in message
> news:1150881311.092232.176500@.y41g2000cwy.googlegroups.com...
> > Code below:
> >
> > If Session("ID") = 1 Or Session("ID") = 2 Then
> > select case (request.form("Individual"))
> > case "Individual" sql = "Select V_Monthreport.Q_ID,
> > V_Monthreport.Answer, V_Monthreport_Q.Question FROM V_Monthreport INNER
> > JOIN V_Monthreport_Q ON V_Monthreport.Q_ID = V_Monthreport_Q.QNo Where
> > V_Monthreport.PersID=" & session("Pers_ID") & " And
> > V_Monthreport.DeptID=" & request.form("SectID") & " And
> > V_Monthreport.Maand=" & request.form("Maand") & " And
> > V_Monthreport.Jaar=" & request.form("Jaar") & " Order By
> > V_Monthreport.Q_ID"
> > case "Section"
> > case "Summary"
> > end select
> > End If
> >
> > <% while not rstMain.eof %>
> > <tr>
> > <td><font face="Tahoma" size="-2" color="Black"><%= rstMain("Q_ID")
> > %></font></td>
> > <td><font face="Tahoma" size="-2" color="Black"><%=> > rstMain("Question") %></font></td>
> > <td><font face="Tahoma" size="-2" color="Black"><%=> > rstMain("Answer") %></font></td>
> > </tr>
> > <% rstMain.movenext
> > wend%>
> > <% End If %>
> >
> > I am experiencing a problem in that the data when displayed is
> > duplicated. The data in the db is not duplicated. So I dont have a clue
> > why the data is displayed in duplicates. Any comments on y?
> >|||No so much
INSERT INTO Table.. VALUES (...
Can you provide a full DDL?
"amatuer" <njoosub@.gmail.com> wrote in message
news:1150883115.391130.319520@.p79g2000cwp.googlegroups.com...
> here's the table:
> CREATE TABLE [dbo].[V_Monthreport] (
> [ID] [int] IDENTITY (1, 1) NOT NULL ,
> [PersID] [int] NULL ,
> [DeptID] [int] NULL ,
> [Datum] [datetime] NULL ,
> [Maand] [int] NULL ,
> [Jaar] [int] NULL ,
> [Q_ID] [int] NULL ,
> [Answer] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
> ) ON [PRIMARY]
> CREATE TABLE [dbo].[V_Monthreport_Q] (
> [ID] [int] IDENTITY (1, 1) NOT NULL ,
> [AfdelingID] [int] NULL ,
> [Afdeling] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [Seksie] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [QNo] [int] NULL ,
> [Question] [nvarchar] (250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
> ) ON [PRIMARY]
> & data looks like this:
> V_Monthreport_Q:
> 14 1 Agricultural Service Agricultural Information Services 1 Marketing
> of available new services of the Department (List Opportunities)
> 15 1 Agricultural Service Agricultural Information
> Services 2 Opportunity/Involvement in identifying and development of
> new clients; products; projects
> 16 1 Agricultural Service Agricultural Information
> Services 3 Involvement in sustaining and improvement of the level of
> expertise, as well as the knowledge and skills
> 17 1 Agricultural Service Agricultural Information Services 4 Intra
> and inter-departmental co-operation (disposition/view)
> 18 1 Agricultural Service Agricultural Information
> Services 5 Agricultural condition/State of Agriculture: Climate
> (temperature, wind, etc)
> 19 1 Agricultural Service Agricultural Information
> Services 6 Agricultural condition/State of Agriculture: Veld (coverage,
> nutritional value)
> 20 1 Agricultural Service Agricultural Information
> Services 7 Agricultural condition/State of Agriculture: Moisture status
> 21 1 Agricultural Service Agricultural Information
> Services 8 Agricultural condition/State of Agriculture: Livestock
> (conditions)
> 22 1 Agricultural Service Agricultural Information
> Services 9 Agricultural condition/State of Agriculture: Commodity
> prices
> 23 1 Agricultural Service Agricultural Information
> Services 10 Agricultural condition/State of Agriculture: Labour
> 24 1 Agricultural Service Agricultural Information
> Services 11 Agricultural condition/State of Agriculture: Security /
> Safe keeping
> 25 1 Agricultural Service Agricultural Information Services 12 Client
> Relations
> 26 1 Agricultural Service Agricultural Information Services 13 Threats
> / Concerns
> V_Monthreport:
> 53 4 1 6/21/2006 6 2006 1 Test1
> 54 4 1 6/21/2006 6 2006 2 Test2
> 55 4 1 6/21/2006 6 2006 4 Test4
> 56 4 1 6/21/2006 6 2006 5 Test5
> 57 4 1 6/21/2006 6 2006 6 Test6
> 58 4 1 6/21/2006 6 2006 8 Test8
> 59 4 1 6/21/2006 6 2006 9 Test9
> 60 4 1 6/21/2006 6 2006 10 Test10
> 61 4 1 6/21/2006 6 2006 11 Test11
> 62 4 1 6/21/2006 6 2006 12 Test12
> 63 4 1 6/21/2006 6 2006 13 Test13
> Sorry but this was the best i could.see if you cn help Uri
> Dimant.thanx.
>
> Uri Dimant wrote:
>> amatuer
>> How do you expect to get a right answer without posting some data to be
>> tested and an expected result.?
>> Take a look at DISTINCT , GROUP BY clause in the BOL
>>
>>
>> "amatuer" <njoosub@.gmail.com> wrote in message
>> news:1150881311.092232.176500@.y41g2000cwy.googlegroups.com...
>> > Code below:
>> >
>> > If Session("ID") = 1 Or Session("ID") = 2 Then
>> > select case (request.form("Individual"))
>> > case "Individual" sql = "Select V_Monthreport.Q_ID,
>> > V_Monthreport.Answer, V_Monthreport_Q.Question FROM V_Monthreport INNER
>> > JOIN V_Monthreport_Q ON V_Monthreport.Q_ID = V_Monthreport_Q.QNo Where
>> > V_Monthreport.PersID=" & session("Pers_ID") & " And
>> > V_Monthreport.DeptID=" & request.form("SectID") & " And
>> > V_Monthreport.Maand=" & request.form("Maand") & " And
>> > V_Monthreport.Jaar=" & request.form("Jaar") & " Order By
>> > V_Monthreport.Q_ID"
>> > case "Section"
>> > case "Summary"
>> > end select
>> > End If
>> >
>> > <% while not rstMain.eof %>
>> > <tr>
>> > <td><font face="Tahoma" size="-2" color="Black"><%= rstMain("Q_ID")
>> > %></font></td>
>> > <td><font face="Tahoma" size="-2" color="Black"><%=>> > rstMain("Question") %></font></td>
>> > <td><font face="Tahoma" size="-2" color="Black"><%=>> > rstMain("Answer") %></font></td>
>> > </tr>
>> > <% rstMain.movenext
>> > wend%>
>> > <% End If %>
>> >
>> > I am experiencing a problem in that the data when displayed is
>> > duplicated. The data in the db is not duplicated. So I dont have a clue
>> > why the data is displayed in duplicates. Any comments on y?
>> >
>|||> The data in the db is not duplicated. So I dont have a clue
> why the data is displayed in duplicates. Any comments on y?
Do you get duplicates when you run the same query from Query Analyzer? The
same rows will be returned multiple times when more than one row exists in
both tables with the same value in the joined columns.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"amatuer" <njoosub@.gmail.com> wrote in message
news:1150881311.092232.176500@.y41g2000cwy.googlegroups.com...
> Code below:
> If Session("ID") = 1 Or Session("ID") = 2 Then
> select case (request.form("Individual"))
> case "Individual" sql = "Select V_Monthreport.Q_ID,
> V_Monthreport.Answer, V_Monthreport_Q.Question FROM V_Monthreport INNER
> JOIN V_Monthreport_Q ON V_Monthreport.Q_ID = V_Monthreport_Q.QNo Where
> V_Monthreport.PersID=" & session("Pers_ID") & " And
> V_Monthreport.DeptID=" & request.form("SectID") & " And
> V_Monthreport.Maand=" & request.form("Maand") & " And
> V_Monthreport.Jaar=" & request.form("Jaar") & " Order By
> V_Monthreport.Q_ID"
> case "Section"
> case "Summary"
> end select
> End If
> <% while not rstMain.eof %>
> <tr>
> <td><font face="Tahoma" size="-2" color="Black"><%= rstMain("Q_ID")
> %></font></td>
> <td><font face="Tahoma" size="-2" color="Black"><%=> rstMain("Question") %></font></td>
> <td><font face="Tahoma" size="-2" color="Black"><%=> rstMain("Answer") %></font></td>
> </tr>
> <% rstMain.movenext
> wend%>
> <% End If %>
> I am experiencing a problem in that the data when displayed is
> duplicated. The data in the db is not duplicated. So I dont have a clue
> why the data is displayed in duplicates. Any comments on y?
>|||Thanx Dan, i sorted it out. The prob was that the inner join was not
unique.Anothr one had to be created in order not to yield more then the
required possible results.
Dan Guzman wrote:
> > The data in the db is not duplicated. So I dont have a clue
> > why the data is displayed in duplicates. Any comments on y?
> Do you get duplicates when you run the same query from Query Analyzer? The
> same rows will be returned multiple times when more than one row exists in
> both tables with the same value in the joined columns.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "amatuer" <njoosub@.gmail.com> wrote in message
> news:1150881311.092232.176500@.y41g2000cwy.googlegroups.com...
> > Code below:
> >
> > If Session("ID") = 1 Or Session("ID") = 2 Then
> > select case (request.form("Individual"))
> > case "Individual" sql = "Select V_Monthreport.Q_ID,
> > V_Monthreport.Answer, V_Monthreport_Q.Question FROM V_Monthreport INNER
> > JOIN V_Monthreport_Q ON V_Monthreport.Q_ID = V_Monthreport_Q.QNo Where
> > V_Monthreport.PersID=" & session("Pers_ID") & " And
> > V_Monthreport.DeptID=" & request.form("SectID") & " And
> > V_Monthreport.Maand=" & request.form("Maand") & " And
> > V_Monthreport.Jaar=" & request.form("Jaar") & " Order By
> > V_Monthreport.Q_ID"
> > case "Section"
> > case "Summary"
> > end select
> > End If
> >
> > <% while not rstMain.eof %>
> > <tr>
> > <td><font face="Tahoma" size="-2" color="Black"><%= rstMain("Q_ID")
> > %></font></td>
> > <td><font face="Tahoma" size="-2" color="Black"><%=> > rstMain("Question") %></font></td>
> > <td><font face="Tahoma" size="-2" color="Black"><%=> > rstMain("Answer") %></font></td>
> > </tr>
> > <% rstMain.movenext
> > wend%>
> > <% End If %>
> >
> > I am experiencing a problem in that the data when displayed is
> > duplicated. The data in the db is not duplicated. So I dont have a clue
> > why the data is displayed in duplicates. Any comments on y?
> >
Sunday, March 11, 2012
Data Conversion Components & Code Page issue
I am using the SSIS wizard to pull data from DB2 z/os to sql server. The data flow task that is created converts the data to DT_STR Ansi 1252 before storing to sql server database. The package is blowing up on in the data conversion component...no match in found in target code page...for my city name field.
My old dts wizard didn't have this problem. The forums seem to indicate that SSIS is no longer doing some of the implicit conversions that DTS did and I may have to do more than one conversion.
What format type/code page do I use for the other conversion? The code page for my DB2 data source is 37.
I've tried several scenarios and none of them have worked. Any hints?
Quick and dirty work around was to change the destination column to nchar.|||This one is a good workaround if you don't mind your strings being Unicode at the destination.
If you would rather keep your ANSI strings, then you should go to the package set the appropriate code page in the data conversion transform and set the appropriate collation in the CREATE TABLE statement.
Thanks.
|||I tried that and couldn't get it to work.
My problem isn't a foreign language issue, but a special character issue. My old DTS packages accepted the special characters without a fuss but I'm told SSIS isn't doing the implicit conversion that the old DTS use to do.
Obviously, I can't seem to figure out which code page to use. And where do I set all of these code pages? My input data is coming from DB2 z/OS which is using code page 37. Do I set the code page of the source component to 37? The destination? The transform component? I tried setting the code page with multiple scenarios...none worked.
There is no where that I can find that explains how to do a code page transformation except in the most general terms.
PS. Wouldn't I only change the collation for a foreign language?
Data Connection to SQL Server 2000 using C#
void page_load(object sender, EventArgs e)
{
SqlConnection myConnection = new SqlConnection("server='(local)'; trusted_connection=true; database='mattsDEMO'"); SqlDataAdapter myCommand = new SqlDataAdapter("select * from people", myConnection);
DataSet ds = new DataSet();
myCommand.Fill(ds, "people");
MyDataGrid.DataSource=ds.Tables["people"].DefaultView;
MyDataGrid.DataBind();
}
When I place a data grid controll on my page named myDataGrid, I do not see a data grid and there is no data either. The code in the HTML looks like this:
<body>
<form runat="server">
<p>
<asp:DataGrid id="myDataGrid" runat="server" BorderColor="Maroon"></asp:DataGrid>
</p>
</form>
</body>
I tried using debug that comes with the .Net framework (since I am using Web Matrix) but I get an error saying no symbols were found for this document when setting break points. What are symbols and why do I need them?
So, I basically have four (4) important questions that I need help answering:
1) Why do I not have any data in my data grid?
2) Where did myDataGrid come from?
3) Is the page_Load method called by default if auto wire is set to true or not declared?
4) Why do I need symbols for debug?
Below is all my code in one complete view:
<%@. Page Language="C#" %>
<%@. Register TagPrefix="wmx" Namespace="Microsoft.Matrix.Framework.Web.UI" Assembly="Microsoft.Matrix.Framework, Version=0.6.0.0, Culture=neutral, PublicKeyToken=6f763c9966660626" %>
<%@. import Namespace="System.Data" %>
<%@. import Namespace="System.Data.SqlClient" %>
<script runat="server">
// Insert page code here
//
</script>
<html>
<head>
<script language="C#">
void page_load(object sender, EventArgs e)
{
SqlConnection myConnection = new SqlConnection("server='(local)'; trusted_connection=true; database='mattsDEMO'");
SqlDataAdapter myCommand = new SqlDataAdapter("select * from people", myConnection);
DataSet ds = new DataSet();
myCommand.Fill(ds, "people");
MyDataGrid.DataSource=ds.Tables["people"].DefaultView;
MyDataGrid.DataBind();
}
</script>
</head>
<body>
<form runat="server">
<p>
</p>
<p>
<asp:Label id="Label1" runat="server">This is a test!</asp:Label>
</p>
<p>
<asp:DataGrid id="myDataGrid" runat="server" BorderColor="Maroon"></asp:DataGrid>
</p>
</form>
</body>
</html>
Thanks,
Ryan
(2) You could set the autogeneratecolumns property of the datagrid to true. I am not good at C#. So I wouldnt try writing code for you.
Thursday, March 8, 2012
Data Binding-DataAdapter
Hi i'm a new to ASP.NET and for some reason when i click the Next button in the code below, the pageIndex does not change. Please assist, Basically what i'm trying to do is to use DataAdapter.fill but passing in the start index and the number of records to pull from the dataset table.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
publicpartialclassHome : System.Web.UI.Page
{
//Connection
OleDbConnection dbConn;//discount that can be change by user using a gui interface
//CurrentPage
int pageIndex = 0;double discount = 0.15 ;protectedvoid Page_Load(object sender,EventArgs e)
{
// homeGridView.Visible = true;
BindList();
}
protectedstring getSpecial(string price,object sale){
String special ="";if (sale.ToString().CompareTo("True") == 0){
special =String.Format("{0:C}",double.Parse(price) * (1-discount));}
return special;}
protectedvoid BindList()
{
//Creating an object for the 'PagedDataSource' for holding the data.
//PagedDataSource objPage = new PagedDataSource();
try
{
//open connection
openConnection();
//sql command
string columns ="*";string SqlCommand ="Select " + columns +" from Books";
//create adapters and DataSet
OleDbDataAdapter myAdapter =newOleDbDataAdapter(SqlCommand, dbConn);DataSet ds =newDataSet("bSet");
//create table
DataTable dt =newDataTable("Books");myAdapter.Fill(ds, pageIndex, 9,"Books");
Response.Write("Page Index: "+pageIndex);
//create table data view
DataView dv =newDataView(ds.Tables["bTable"]);booksDataList.DataSource = ds;
booksDataList.DataBind();
myAdapter.Dispose();
dbConn.Close();
}
catch (Exception ex){
Response.Write("Exception thrown in BindList()");
dbConn.Close();
throw ex;}
}
publicvoid openConnection()
{
string provider="Microsoft.Jet.OLEDB.4.0";string dataSource ="C:/Documents and Settings/Owner/My Documents/Visual Studio 2005/WebSites/E-BookOnline/App_Data/BooksDB.mdb";
dbConn =newOleDbConnection("Provider =" + provider +";" +"Data Source =" + dataSource);dbConn.Open();
}
protectedvoid nextClick(object sender,EventArgs e){
pageIndex=pageIndex+1;
Response.Write("In nextClick"+pageIndex);BindList();
}
protectedvoid prevClick(object sender,EventArgs e){
if (pageIndex > 0){
pageIndex=pageIndex-1;
BindList();
}
}
}
It is not advisable to use DataAdpater to page records... instead of this you need to use queries for that but anyway you can found this article useful.
http://msdn2.microsoft.com/en-us/library/tx1c9c2f(VS.80).aspx
Satya
Saturday, February 25, 2012
Data access from Report Server
dll to access data from a remote SQL Server. On my development machine, I
can view the report without a problem. When I deploy the report to the
Report Server (Windows Server 2003), I get the following:
Request For The Permission Of Type
System.Data.Sqlclient.Sqlclientpermission, System.Data, Version=1
I followed the steps in article 842419 to allow the permissions for this
assembly, but I still can not get it to work.I am having the exect same problem.
"dyarbrough" wrote:
> Here is my problem. I am using code in a report that uses the System.Data
> dll to access data from a remote SQL Server. On my development machine, I
> can view the report without a problem. When I deploy the report to the
> Report Server (Windows Server 2003), I get the following:
> Request For The Permission Of Type
> System.Data.Sqlclient.Sqlclientpermission, System.Data, Version=1
> I followed the steps in article 842419 to allow the permissions for this
> assembly, but I still can not get it to work.
Friday, February 24, 2012
DAO Error code 0xbd7
I have a button in vb calling crsytal reports 9 . These reports are opening in cr viewer. I have an access database secured with a password. I can open the report but when I go to enter new parameters in the cr viewer, I get this error.
"LOGON FAILED"
Details: DAO Error Code 0xbd7
Source: Dao.Workspace
Description: Not a valid Password
Im lost on this one and I would be grateful for some help.
Thanks!!Hello,
This is in C#, I thing it can help you :
crystalReportDocument1.DataSourceConnections[0].SetConnection(SERVER, Database, "USERNAME", "YOUR PASSWORD"); crystalReportViewer1.ReportSource = crystalReportDocument1;
I use Microsoft Access file, so I left the Username blank, and for Server and Database put the new path to my .mdb file.
I hope it helps.
DAO and SQL server
SQL server. All the code is in DAO, are there any known
incompatibilities WRT SQL server and DAO?
Many thanks
SiSd (sd_bradford@.hotmail.com) writes:
> We are considering migrating a large piece of VB code from Access to
> SQL server. All the code is in DAO, are there any known
> incompatibilities WRT SQL server and DAO?
I have never used DAO, but a colleague of mine told me the other day,
that DAO was designed for Access, and is cumbersome to use with SQL Server.
In any case, DAO is old technology, and I would suspect that you don't get
full support for newer features in SQL Server with DAO, but I could be wrong
on that particular point. Nevertheless, I would consider ripping out DAO
in favour of ADO which is more up to date. Admittedly, I find ADO quite
ugly as well, and ADO .Net is a lot more palatable. That would however call
for a migration to VB .Net, which may be an overkill.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||"Sd" <sd_bradford@.hotmail.com> wrote in message
news:e66eafb3.0412200220.17a18286@.posting.google.c om...
> We are considering migrating a large piece of VB code from Access to
> SQL server. All the code is in DAO, are there any known
> incompatibilities WRT SQL server and DAO?
> Many thanks
> Si
There's stuff you can do with tables and queries which would probably cause
a problem.
You can forget compact and repair operations.
Table search is potentially a problem as you'll minimum have to switch to
(SQL) attached tables.
Hopefully the code and data is already split between two databases?
If you just use a bunch of selects and inserts then they're quite possibly
going to be relatively painless to convert.
If you have to do it anyhow.
I would suggest create corresponding sql tables manually.
Perhaps start off using DTS to load em in and see what you get.
Attach these to a copy of your code database.
Give it a twirl and see what happens.
--
Regards,
Andy O'Neill
Friday, February 17, 2012
CVS Export in ASCII format
had to add a report link using the below code to fix the problem. Is
there a way to change the underlying export encoding in reporting
services?
="javascript:void(window.open(top.frames[0].frames[1].location.href.replace('Format=HTML4.0','Format=CSV&rc%3aEncoding=ASCII'),'_blank'))"There is for RS 2005. Not for RS 2000.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
<slov1@.hotmail.com> wrote in message
news:1135297330.158158.120010@.g49g2000cwa.googlegroups.com...
> For the CSV export problem, where excel opens data into one column, I
> had to add a report link using the below code to fix the problem. Is
> there a way to change the underlying export encoding in reporting
> services?
> ="javascript:void(window.open(top.frames[0].frames[1].location.href.replace('Format=HTML4.0','Format=CSV&rc%3aEncoding=ASCII'),'_blank'))"
>