Showing posts with label net. Show all posts
Showing posts with label net. Show all posts

Friday, March 30, 2012

Problem with SQLXML BulkLoad from .NET Application

I am using BulkLoad from .NET application as follows

SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class obj = new SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class();

obj.ConnectionString = "Provider=SQLOLEDB;Server=serverName;Database=dbName;Integrated Security=SSPI";

obj.ErrorLogFile = Application.StartupPath + @."\Error.log";

obj.IgnoreDuplicateKeys = true;

try

{

obj.Execute(Application.StartupPath + @."\Schema1.xsd", Application.StartupPath + @."\Data1.xml");

obj.Execute(Application.StartupPath + @."\Schema2.xsd", Application.StartupPath + @."\Data2.xml");

}

catch (Exception ex)

{

throw ex;

}

I get following error when I run my application:

InvalidCastException was unhandled by user code.

Unable to cast COM object of type 'SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class' to interface type 'SQLXMLBULKLOADLib.ISQLXMLBulkLoad4'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{88465BA7-AEEE-49A1-9499-4416287A0160}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

When I run the same code in a Console application it works alright. In my application the code is executed on a Background thread, could that be cause of exception? Please help.

Thanks

From SQL Server Books Online :

Using SQLXML Bulk Load in the .NET Environment

The reference to the Bulk Load component (xblkld4.dll) can also be added using the tlbimp.exe tool, which is available as part of .NET framework. This tool creates a managed wrapper for the native DLL (xblkld4.dll), which can then be used in any .NET project. For example:

c:\>tlbimp xblkld4.dll

This creates the managed wrapper DLL (SQLXMLBULKLOADLib.dll) that you can use in the .NET Framework project. In the .NET Framework, you add project reference to the newly created DLL.

Please follow the link for more info :

http://msdn2.microsoft.com/en-us/library/ms171878.aspx.

This will solve your issue.

Thanks

Naras.

|||

I think you should use

[STAThread]

staticvoid Main(string[] args)

{

//your code

}

|||I am having the same problem, however, running tlbimp does not fix it. I have to run tlbimp on the full path to the DLL because it can't find it unless I specify it. I get the same error. Please help!

Problem with SQLXML BulkLoad from .NET Application

I am using BulkLoad from .NET application as follows

SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class obj = new SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class();

obj.ConnectionString = "Provider=SQLOLEDB;Server=serverName;Database=dbName;Integrated Security=SSPI";

obj.ErrorLogFile = Application.StartupPath + @."\Error.log";

obj.IgnoreDuplicateKeys = true;

try

{

obj.Execute(Application.StartupPath + @."\Schema1.xsd", Application.StartupPath + @."\Data1.xml");

obj.Execute(Application.StartupPath + @."\Schema2.xsd", Application.StartupPath + @."\Data2.xml");

}

catch (Exception ex)

{

throw ex;

}

I get following error when I run my application:

InvalidCastException was unhandled by user code.

Unable to cast COM object of type 'SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class' to interface type 'SQLXMLBULKLOADLib.ISQLXMLBulkLoad4'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{88465BA7-AEEE-49A1-9499-4416287A0160}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

When I run the same code in a Console application it works alright. In my application the code is executed on a Background thread, could that be cause of exception? Please help.

Thanks

From SQL Server Books Online :

Using SQLXML Bulk Load in the .NET Environment

The reference to the Bulk Load component (xblkld4.dll) can also be added using the tlbimp.exe tool, which is available as part of .NET framework. This tool creates a managed wrapper for the native DLL (xblkld4.dll), which can then be used in any .NET project. For example:

c:\>tlbimp xblkld4.dll

This creates the managed wrapper DLL (SQLXMLBULKLOADLib.dll) that you can use in the .NET Framework project. In the .NET Framework, you add project reference to the newly created DLL.

Please follow the link for more info :

http://msdn2.microsoft.com/en-us/library/ms171878.aspx.

This will solve your issue.

Thanks

Naras.

|||

I think you should use

[STAThread]

static void Main(string[] args)

{

//your code

}

|||I am having the same problem, however, running tlbimp does not fix it. I have to run tlbimp on the full path to the DLL because it can't find it unless I specify it. I get the same error. Please help!

Problem with SQLXML BulkLoad from .NET Application

I am using BulkLoad from .NET application as follows

SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class obj = new SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class();

obj.ConnectionString = "Provider=SQLOLEDB;Server=serverName;Database=dbName;Integrated Security=SSPI";

obj.ErrorLogFile = Application.StartupPath + @."\Error.log";

obj.IgnoreDuplicateKeys = true;

try

{

obj.Execute(Application.StartupPath + @."\Schema1.xsd", Application.StartupPath + @."\Data1.xml");

obj.Execute(Application.StartupPath + @."\Schema2.xsd", Application.StartupPath + @."\Data2.xml");

}

catch (Exception ex)

{

throw ex;

}

I get following error when I run my application:

InvalidCastException was unhandled by user code.

Unable to cast COM object of type 'SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class' to interface type 'SQLXMLBULKLOADLib.ISQLXMLBulkLoad4'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{88465BA7-AEEE-49A1-9499-4416287A0160}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

When I run the same code in a Console application it works alright. In my application the code is executed on a Background thread, could that be cause of exception? Please help.

Thanks

From SQL Server Books Online :

Using SQLXML Bulk Load in the .NET Environment

The reference to the Bulk Load component (xblkld4.dll) can also be added using the tlbimp.exe tool, which is available as part of .NET framework. This tool creates a managed wrapper for the native DLL (xblkld4.dll), which can then be used in any .NET project. For example:

c:\>tlbimp xblkld4.dll

This creates the managed wrapper DLL (SQLXMLBULKLOADLib.dll) that you can use in the .NET Framework project. In the .NET Framework, you add project reference to the newly created DLL.

Please follow the link for more info :

http://msdn2.microsoft.com/en-us/library/ms171878.aspx.

This will solve your issue.

Thanks

Naras.

|||

I think you should use

[STAThread]

static void Main(string[] args)

{

//your code

}

|||I am having the same problem, however, running tlbimp does not fix it. I have to run tlbimp on the full path to the DLL because it can't find it unless I specify it. I get the same error. Please help!

Problem with SQLServer 2000

i installed the Visual Studio 2004+ Framework.NET 2

and SQLserver 2005

after those

i installed SQLserver 2000

and i got this :

http://img240.imageshack.us/img240/7392/sql2fk.jpg

thank you

This is the wrong forum. From your screenshot it looks like you should be checking the Express forum: http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=385&SiteID=1

In the meantime, have you checked in the Services panel that SQL Server is running?

Have you enabled remote conenctions using the Surface Area configuraiton tool?

-Jamie

|||what should i change here?

http://img86.imageshack.us/img86/746/remote6np.jpg

thank you|||

From the screenshot http://img240.imageshack.us/img240/7392/sql2fk.jpg - it looks like you are trying to access SQL Server 2005 Express Edition from SQL Server Enterprise Manager.

Try accessing SQL Server 2005 express edition from SQL Server Management Studio (which is equivalent of SQL Server 2000 Enterprise manager for SQL Server 2005.)

Thanks,
Loonysan

|||i dont know what do u mean...

i even dont need SQL server 2005 i need only the 2000...

but i have heard that removing SQL server 2005 from my computer wont work...

can someone give me step by step what to do to solve the problem...

thank you :D|||

deViance wrote:

i dont know what do u mean...
i even dont need SQL server 2005 i need only the 2000...
but i have heard that removing SQL server 2005 from my computer wont work...
can someone give me step by step what to do to solve the problem...

thank you :D

For a starter, you are in the wrong place.

If you don't need SQL2005 why did you install it? What exactly are you trying to do?

-Jamie

Problem with SqlCacheDependency

I've set up a SqlCacheDependency in my Asp.Net application, but the dependency invalidates the cache immediately every time the page is hit.

I think the problem may be with my SQL Query, but it seems to me to meet the requirements on the Special Considerations When Using Query Notifications page on MSDN. Could someone take a look at this query and tell me if I've done something wrong? Thank you.

Here's my query:

Code Snippet

USE [chameleon]

GO

SET ANSI_NULLS ON

GO

SET ANSI_PADDING ON

GO

SET ANSI_WARNINGS ON

GO

SET CONCAT_NULL_YIELDS_NULL ON

GO

SET QUOTED_IDENTIFIER ON

GO

SET NUMERIC_ROUNDABORT OFF

GO

SET ARITHABORT ON

GO

ALTER PROCEDURE [dbo].[usp_customers_by_site_id]

@.site_id INT

AS

SELECT

customers.customer_id,

customers.name,

customers.po_prefix,

customers.dt_created,

customers.created_by AS auid,

customers.po_required

FROM dbo.customers

WHERE customers.site_id = @.site_id

AND customers.is_active = 1

and here's the code in my Asp.Net site where I try to use the SqlCacheDependency:

Code Snippet

public List<Customer> GetCustomersBySite(int siteID)

{

List<Customer> customers = new List<Customer>();

if (HttpRuntime.Cache["CustomersBySite" + siteID] != null){

customers = (List<Customer>)HttpRuntime.Cache["CustomersBySite" + siteID];

}

else

{

using (SqlCommand command = new SqlCommand("usp_customers_by_site_id", Connection)){

command.CommandType = CommandType.StoredProcedure;

command.Parameters.Add("@.site_id", SqlDbType.Int).Value = GetDBValue(siteID, false);

SqlCacheDependency dependency = new SqlCacheDependency(command);

try{

Connection.Open();

SqlDataReader reader;

reader = command.ExecuteReader(CommandBehavior.SingleResult);

while (reader.Read()){

customers.Add(PopulateCustomer(reader));

}

HttpRuntime.Cache.Insert("CustomersBySite" + siteID, customers, dependency, DateTime.Now.AddMinutes(Configuration.CacheDuration), System.Web.Caching.Cache.NoSlidingExpiration);

}

finally{

Connection.Close();

}

}

}

return customers;

}

My apologies. I posted this in the wrong forum.

-Brad

Problem with SQL string using MS Access and OleDbConnection (ASP .NET)

The string concatination below works in the Query builder built-in to MS Access, but when I try it as an OleDbCommand it doesn't work.

SELECT ID, LastName + ', ' + FirstName AS Names FROM AgentNames;

Is there any other ways to return a combination like this using an OleDbCommand?

Thanks,

GrierOriginally posted by grier_allen
The string concatination below works in the Query builder built-in to MS Access, but when I try it as an OleDbCommand it doesn't work.

SELECT ID, LastName + ', ' + FirstName AS Names FROM AgentNames;

Is there any other ways to return a combination like this using an OleDbCommand?

Thanks,

Grier

Shot in the dark here but try [LastName + ',' + FirstName] as Names. If not, I dont know why that won't work.

Wednesday, March 28, 2012

Problem with SQL Server and odbc, please help me!

I have Visual Studio Dot.Net on Win XP and use the MSDE to access to Sql
Server.
This morning I've attempt to create a new ODBC DSN for Sql Server so
I've executed the wizard for a new System DSN by the ODBC administrator
of Windows. But when it attempts to connect to the server (the third
step of wizard) it give me somewhat like:
Connection impossible.
SQLState: '01000'
SQL Server error: 10049
SQLState: '08001'
SQL Server error: 17
I've tried to go forward with the manual configuration (uncheck the item
"Connect to an SQL Server for the default settings.." and press the Next
button), but at the end, when I press "Verify the data source", I have
no connection. So I've canceled the wizard.
The problem is that after that moment I have no connection with the server.
The console of MSDE indicate that the server is normally running, but I
can't connect to it neither by the Server Explorer of VS nor by osql.
I have always a message like:
[DBNETLIB][ConnectionOpen(Connect()).]Server non found or access denied.
Can someone help me?
Thanks
Tonio Tanzi
P.s. the messages of the server are probably a little different by the
ones indicate by me because I've translated them from the italian version.Tonio,
Is this a development server? If so try stopping the SQL Server service and
restarting it.
HTH
Jerry
"Tonio Tanzi" <vi.tan.gr@.inwind.it> wrote in message
news:m8c%e.3633$EZ.98724@.twister1.libero.it...
>I have Visual Studio Dot.Net on Win XP and use the MSDE to access to Sql
>Server.
> This morning I've attempt to create a new ODBC DSN for Sql Server so I've
> executed the wizard for a new System DSN by the ODBC administrator of
> Windows. But when it attempts to connect to the server (the third step of
> wizard) it give me somewhat like:
> Connection impossible.
> SQLState: '01000'
> SQL Server error: 10049
> SQLState: '08001'
> SQL Server error: 17
> I've tried to go forward with the manual configuration (uncheck the item
> "Connect to an SQL Server for the default settings.." and press the Next
> button), but at the end, when I press "Verify the data source", I have no
> connection. So I've canceled the wizard.
> The problem is that after that moment I have no connection with the
> server.
> The console of MSDE indicate that the server is normally running, but I
> can't connect to it neither by the Server Explorer of VS nor by osql.
> I have always a message like:
> [DBNETLIB][ConnectionOpen(Connect()).]Server non found or access denied.
>
> Can someone help me?
> Thanks
> Tonio Tanzi
> P.s. the messages of the server are probably a little different by the
> ones indicate by me because I've translated them from the italian version.|||Jerry Spivey ha scritto:
> Tonio,
> Is this a development server? If so try stopping the SQL Server service a
nd
> restarting it.
Yes. I've just stopped and restarted both Sql Server and computer many
times widhout any result.
Other suggest?
Bye
Tonio Tanzi

Monday, March 26, 2012

Problem with SQL in ASP.NET...

Hello,

I have the following SELECT statement I am using in asp.net page:

SELECT MonthName(Month([TransEntryDate])) AS MonthListed, Sum(Transactions.ListingPrice) AS SumOfListingPrice FROM Transactions GROUP BY MonthName(Month([TransEntryDate]));

I get the following error:

Undefined function 'MonthName' in expression.

This used to work with classic ASP, but I'm not sure how to form this to work with ASP.NET. I am using this because my results are showing months numerically and I'd like them to be returned with the actual month name (january, february, etc.)...

Any help would be greatly appreciated!MonthName is not a SQL Server keyword, its only support in Analysis Services. Is you .net project pointing to the same database as your classic asp?|||Yes pointing to same db... I'm not sure how to get the results I'm looking for though...|||Yes...pointing to same db, but not sure how to make this work for the results I need...|||I think that what I'm looking for is an example of how I could use the CASE Expression within my SELECT statement to return the month name (not the numeric value)... PLEASE HELP!!!!|||ah now why didn't you say so ;)


SELECT DATENAME(month, getdate()) AS 'Month Name'
|||I hate to be a pain...I'm new to this... Could you show me how to use this with my SELECT statement in my first post? Thank you!!!|||

SELECT DateName(month,[TransEntryDate]) AS MonthListed, Sum(Transactions.ListingPrice) AS SumOfListingPrice FROM Transactions GROUP BY [TransEntryDate]

NB Simply using "Group By" doesn't guarantee a sorted order.

Friday, March 9, 2012

Problem with ReportViewer Control

I have an ASP.NET web site with form authentication.

When I use a ReportViewer control in a page (with a masterPage) and my report (ServerReport and Remote processingmode) has DateTime parameters I can't see that calendar gif in order to select a date. Same thing with a DropDownList bound to a dataset for another paramater (I can't see that arrow from the right side of DropDownList so I can't dropdown it).

When I want to see the report with a browser direct from my Reports site it works fine. Only in reportviewer has this simptoms.

IE has some errors in script

1. 'RSClientController' is undefined

2. 'ClientControllerctl00_contentPanel_ReportViewer1' is null or not an object.

3. 'DropDownParamClass' is undefined.

I found other posts with the same simptoms:

http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=327473&SiteID=1

http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=358590&SiteID=1

but the solution found there doesn't apply to me.

Any suggestions ?

Hi Sorin,
I have the same problem regarding Reporting Service. Is this problem has been solved ? Could you please advice me how to solve the problem?

Best Regards,

Joko|||A work around could be to use a IFrame and changing its source to the report you would like to display.

Problem with ReportViewer Control

I have an ASP.NET web site with form authentication.

When I use a ReportViewer control in a page (with a masterPage) and my report (ServerReport and Remote processingmode) has DateTime parameters I can't see that calendar gif in order to select a date. Same thing with a DropDownList bound to a dataset for another paramater (I can't see that arrow from the right side of DropDownList so I can't dropdown it).

When I want to see the report with a browser direct from my Reports site it works fine. Only in reportviewer has this simptoms.

IE has some errors in script

1. 'RSClientController' is undefined

2. 'ClientControllerctl00_contentPanel_ReportViewer1' is null or not an object.

3. 'DropDownParamClass' is undefined.

I found other posts with the same simptoms:

http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=327473&SiteID=1

http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=358590&SiteID=1

but the solution found there doesn't apply to me.

Any suggestions ?

Hi Sorin,
I have the same problem regarding Reporting Service. Is this problem has been solved ? Could you please advice me how to solve the problem?

Best Regards,

Joko
|||A work around could be to use a IFrame and changing its source to the report you would like to display.

Problem with report viewer

Hi,

I recently upgraded by ASP.Net 1.1 application to 2.0. 1.1 application was using awReportViewer to view the reports.

But, when upgraded, awreportViewer doesnt display the RS2005 enhancements like sorting, etc...so I decided to replace it with Report Viewer control in VS2005.

Now the problem starts, Whenever I try accesing the reports through application, it gives me error "Client found response content type of '', but expected 'text/xml'.
The request failed with an empty response."

This is how I have coded,

ReportViewer1.ProcessingMode = ProcessingMode.Remote

ReportViewer1.ServerReport.ReportServerUrl = New Uri(http://localhost/ReportServer/reportservice.asmx)

ReportViewer1.ServerReport.ReportPath = reportname

//Some code to set parameters in Report Paramater "parameters"

ReportViewer1.ServerReport.SetParameters(parameters)

My questions:

1. Am I going wrong somewhere in the above code?

2. Can awReportViewer be modified / upgraded so that it can support RS2005 features like sorting, multivalued parameters?

TIA

Tanmaya

Change the ReportServerUrl to be 'http://localhost/reportserver' and you should be in business.|||Great...its working now...thanks a ton :)

Wednesday, March 7, 2012

problem with repeating records

hello i'm using asp.net 2 with VB and i have a table in my db the problem is that table has a repeated records likethis image
now i want to update the absence record but cos it's repeated it will only update one record what i want is to apply the update on all other records ? hope u can help me .thankscan you rephrase your question? What is the UPDATE statement you have currently?|||hello ndinakar, i will explain my prob again i have a page has a details view and sqldatasource the details show one record as u know there are some records repeated as in the image i posted i'm using the sqldatasource auto statement update, but it doesnt update and it did updated once but only one value and the other repeatd values still as they are what i want is when i update one value it auto update all other repeated values, hope this clear and hope u can help me.|||What is the UPDATE statement you have? Do you have any primary key for the table? Pls post the table structure and some sample data.|||ok this my table's columns :
ID uniqueidentifier(primary key)
serial Int
stage(1st grade,2nd grade,...etc) char
class nchar
subject varchar
marks char
total nchar
absence nchar
ranking char

the update statement is the auto generated statement in the sqldatasource here's the sqldatasource code in my page:

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues"
ConnectionString="<%$ ConnectionStrings:aspnetcon %>" DeleteCommand="DELETE FROM [grades] WHERE [id] = @.original_id AND [serial] = @.original_serial AND [stage] = @.original_stage AND [class] = @.original_class AND [subject] = @.original_subject AND [marks] = @.original_marks AND [total1] = @.original_total1 AND [total2] = @.original_total2 AND [status] = @.original_status AND [absence] = @.original_absence AND [ranking] = @.original_ranking"
InsertCommand="INSERT INTO [grades] ([id], [serial], [stage], [class], [subject], [marks], [total1], [total2], [status], [absence], [ranking]) VALUES (@.id, @.serial, @.stage, @.class, @.subject, @.marks, @.total1, @.total2, @.status, @.absence, @.ranking)"
OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM [grades] WHERE (([stage] = @.stage) AND ([subject] = @.subject) AND ([class] = @.class))"
UpdateCommand="UPDATE [grades] SET [serial] = @.serial, [stage] = @.stage, [class] = @.class, [subject] = @.subject, [marks] = @.marks, [total1] = @.total1, [total2] = @.total2, [status] = @.status, [absence] = @.absence, [ranking] = @.ranking WHERE [id] = @.original_id AND [serial] = @.original_serial AND [stage] = @.original_stage AND [class] = @.original_class AND [subject] = @.original_subject AND [marks] = @.original_marks AND [total1] = @.original_total1 AND [total2] = @.original_total2 AND [status] = @.original_status AND [absence] = @.original_absence AND [ranking] = @.original_ranking">
<DeleteParameters>
<asp:Parameter Name="original_id" Type="Object" />
<asp:Parameter Name="original_serial" Type="Int32" />
<asp:Parameter Name="original_stage" Type="String" />
<asp:Parameter Name="original_class" Type="String" />
<asp:Parameter Name="original_subject" Type="String" />
<asp:Parameter Name="original_marks" Type="String" />
<asp:Parameter Name="original_total1" Type="String" />
<asp:Parameter Name="original_total2" Type="String" />
<asp:Parameter Name="original_status" Type="String" />
<asp:Parameter Name="original_absence" Type="String" />
<asp:Parameter Name="original_ranking" Type="String" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="serial" Type="Int32" />
<asp:Parameter Name="stage" Type="String" />
<asp:Parameter Name="class" Type="String" />
<asp:Parameter Name="subject" Type="String" />
<asp:Parameter Name="marks" Type="String" />
<asp:Parameter Name="total1" Type="String" />
<asp:Parameter Name="total2" Type="String" />
<asp:Parameter Name="status" Type="String" />
<asp:Parameter Name="absence" Type="String" />
<asp:Parameter Name="ranking" Type="String" />
<asp:Parameter Name="original_id" Type="Object" />
<asp:Parameter Name="original_serial" Type="Int32" />
<asp:Parameter Name="original_stage" Type="String" />
<asp:Parameter Name="original_class" Type="String" />
<asp:Parameter Name="original_subject" Type="String" />
<asp:Parameter Name="original_marks" Type="String" />
<asp:Parameter Name="original_total1" Type="String" />
<asp:Parameter Name="original_total2" Type="String" />
<asp:Parameter Name="original_status" Type="String" />
<asp:Parameter Name="original_absence" Type="String" />
<asp:Parameter Name="original_ranking" Type="String" />
</UpdateParameters>
<SelectParameters>
<asp:CookieParameter CookieName="stg" Name="stage" Type="String" />
<asp:CookieParameter CookieName="sub" Name="subject" Type="String" />
<asp:ControlParameter ControlID="DropDownList1" Name="class" PropertyName="SelectedValue"
Type="String" />
</SelectParameters>
<InsertParameters>
<asp:Parameter Name="id" Type="Object" />
<asp:Parameter Name="serial" Type="Int32" />
<asp:Parameter Name="stage" Type="String" />
<asp:Parameter Name="class" Type="String" />
<asp:Parameter Name="subject" Type="String" />
<asp:Parameter Name="marks" Type="String" />
<asp:Parameter Name="total1" Type="String" />
<asp:Parameter Name="total2" Type="String" />
<asp:Parameter Name="status" Type="String" />
<asp:Parameter Name="absence" Type="String" />
<asp:Parameter Name="ranking" Type="String" />
</InsertParameters>
</asp:SqlDataSource
the problem is there's a 5 or 6 subjects to every student and each subject in the table has a repeated record here's aone studentin my table so as u can see in this image the repeating records for example the absence and status columns, what i want is really simple i want when i update the absence for example i want to apply that update on all records not only one record hope u understand me .thanks for the help|||sorry. I am having internet problems at home so I could not reply earlier. I think if you remove the @.original_Id parameter from your where clause you could update all the records. Basically your WHERE condition is limiting the records. Based on your screenshot it appears all the other columns have same values except the @.original_id which is not in the screenshot. So I am guessing that is the condition limiting your results.

Problem with repeater

I'm new to ASP.NET and i've been banging my head aganist this problem for a few days now.

I have a repeater and then a repeater inside that repeater.

<asp:SqlDataSource ID="sqlRepeater1" runat="server" ConnectionString="<%$ ConnectionStrings:Inspections_DBCS %>"
SelectCommand="SELECT count(*) as mycount FROM insuranceco with (NOLOCK) where insurancecoid=@.insurancecoid" OnSelecting="sqlRepeater_Selecting" >
<SelectParameters>
<asp:Parameter DefaultValue='' Name="insurancecoid" Type="String" />
</SelectParameters>
</asp:SqlDataSource
<%
'sqlRepeater1.SelectParameters["insurancecoid"].DefaultValue = "123";
%
This returns:
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30451: Name 'sqlRepeater1' is not declared.
Source Error:

Line 38:
Line 39: <%
Line 40: sqlRepeater1.SelectParameters["insurancecoid"].DefaultValue = "123";
Line 41: %>
Line 42:

I tried a solution i saw on the web about using the onselecting event but that didn't pan out either

Protected Sub sqlRepeater_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs) 'Handles sqlRepeater1.Selecting WithEvents
'Response.Write(e.Command.Parameters.Add)
'e.Command.Parameters.Add(e.Command.CreateParameter("P1", "test"))
'e.Command.Parameters.Add("P1", "value")

I have to be doing something wrong because i would think there has to be a way to reference variables when you are going from repeater to repeater i just dont know.

Please help my mask of sanity is starting to slip off.

Thanks

You can put this line in any event in the code behind file:

sqlRepeater1.SelectParameters["insurancecoid"].DefaultValue = "123";

You're using SqlDataSource yet I haven't seen where is the repeater.

|||There is the whole page as it is. I'm going to try putting that
sqlRepeater1.SelectParameters["insurancecoid"].DefaultValue = "123";

in the codebehind now and see what happens.

<%@. Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="ProcessOrders.aspx.vb" Inherits="ProcessOrders" title="Process Inspection Orders" %
<asp:Content ID="Content1" ContentPlaceHolderID="CPH1" Runat="Server"
<h1>Process Inspection Orders</h1>
<hr /
<asp:SqlDataSource ID="InspectionCompanys" runat="server" ConnectionString="<%$ ConnectionStrings:Inspections_DBCS %>"
SelectCommand="select inspectioncompany,inspectioncoid from inspectionco with (NOLOCK)"
</asp:SqlDataSource
<asp:SqlDataSource ID="sqlRepeater" runat="server" ConnectionString="<%$ ConnectionStrings:Inspections_DBCS %>"
SelectCommand="SELECT insurancecompany,insurancecoid FROM insuranceco with (NOLOCK) ">
</asp:SqlDataSource
<asp:Repeater id="ProcessOrder" EnableViewState="False" runat="server" DataSourceID="sqlRepeater">
<HeaderTemplate>
<table width="600" cellpadding="3" cellspacing="0">
</HeaderTemplate>
<ItemTemplate
<asp:SqlDataSource ID="sqlRepeater1" runat="server" ConnectionString="<%$ ConnectionStrings:Inspections_DBCS %>"
SelectCommand="SELECT count(*) as mycount FROM insuranceco with (NOLOCK) where insurancecoid=@.insurancecoid" OnSelecting="sqlRepeater_Selecting" >
<SelectParameters>
<asp:Parameter DefaultValue='' Name="insurancecoid" Type="String" />
</SelectParameters>
</asp:SqlDataSource
<%
sqlRepeater1.SelectParameters["insurancecoid"].DefaultValue = "123";
%
<tr>
<td style='width: 35%; height: 32px'>
<asp:Label ID="lblViewCompanyName" runat="server" Text='<%# EVAL("InsuranceCompany") %>'/></td>
<td style='height: 32px'>
<asp:Repeater ID="InsideLoop" EnableViewState=false runat="server" DataSourceID="SqlRepeater1">
<ItemTemplate>
<asp:Label ID="numberofrecords" runat="server" Text='<%# EvaL("mycount") %>'/>
</ItemTemplate>
</asp:Repeater
</td>
<td style='height: 32px'>
<asp:Label ID="lblInspectionCompany" runat="server" Text="Inspection Company:"/></td>
<td style='height: 32px'>
<asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="InspectionCompanys" DataTextField="inspectioncompany" DataValueField="inspectioncoid" Value="test" />
</td>
<td>
<asp:Label runat="server" ID="lblAssignDate" Text="Assign Date:"></asp:Label><asp:TextBox ID="txtAssignDate1" runat="server"/>
</td>
<td>
<asp:Button ID="btAssign" runat="server" Text="Assign" />
</td>
</tr>
</ItemTemplate>
<SeparatorTemplate>
<!--<hr />-->
</SeparatorTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
</asp:Content|||Here is the codebehind

Imports System.Data
Imports System.Data.SqlClient

Public Class ProcessOrders
Inherits Page

Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

'Call BuildUserGrid()

End Sub

Sub BuildUserGrid(ByRef txtAssignDate As TextBox)

'ProcessOrder.DataSource = GetOrder()
'ProcessOrder.DataBind()
'Call GetOrder()
txtAssignDate.Text = "TEST"

End Sub

Function GetOrder() As DataView

Dim dstUsers As DataSet
Dim objConnection As SqlConnection
Dim dadResults As SqlDataAdapter
Dim dvwUsers As DataView

Dim strServer As String 'Which server is this connection
Dim strDatabase As String 'Which database is this connection
Dim strUserID As String 'What SQL Server UserName
Dim strPassword As String 'What SQL Server Password
Dim strQuery As String 'My SQL QUERY

strServer = ConfigurationSettings.AppSettings("server")
strDatabase = ConfigurationSettings.AppSettings("database")
strUserID = ConfigurationSettings.AppSettings("userid")
strPassword = ConfigurationSettings.AppSettings("password")

strQuery = "SELECT insurancecompany "
strQuery = strQuery & "FROM insuranceco with (NOLOCK) "

Response.Write("WOW")

'dvwUsers = Cache("MyInspection")
If dvwUsers Is Nothing Then
dstUsers = New DataSet()
objConnection = New SqlConnection("Server=" & strServer & ";UID=" & strUserID & ";PWD=" & strPassword & ";Database=" & strDatabase)
dadResults = New SqlDataAdapter(strQuery, objConnection)
dadResults.Fill(dstUsers, "MyInspection")
dvwUsers = dstUsers.Tables("MyInspection").DefaultView()
'Cache("MyInspection") = dvwUsers
End If

'objConnection.Close()

Return dvwUsers

End Function

Protected Sub sqlRepeater_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs) 'Handles sqlRepeater1.Selecting WithEvents
'Response.Write(e.Command.Parameters.Add)
'e.Command.Parameters.Add(e.Command.CreateParameter("P1", "test"))
'e.Command.Parameters.Add("P1", "value")

'insurancecoid

End Sub
End Class|||When i put the sqlrepeater1 line it gives me an error.
But it only errors when i have the repeater inside the first repeater.
Is it impossible to do a repeater inside a repeater? Is there some longer way to reference a variable when you are inside a repeater because it just seems like it is something to do with being inside repeater #1.

If i put the 2nd repeater (sqlrepeater1) and the code outside of the first repeater it works.

Compiler Error Message: BC30451: Name 'sqlRepeater1' is not declared.

Source Error:

Line 73: 'insurancecoid
Line 74:
Line 75: sqlRepeater1.SelectParameters["insurancecoid"].DefaultValue = "123";
Line 76: End Sub
Line 77: End Class

Problem with regional settings I think

I have a developer server (which we run ASP.NEt solutions against) it's an
MSDE instance and then we have another "LIVE" server which also has an MSDE
instance.
We are using Crystal Reports to get Reports out of the Databases and the
reports look different when we run them against the servers.
A Total ( in the report) on our Develooper Server shows as 2,00 in the
report but on out LIVE one.. it shows as 200,00 ... so I'm thinking it has
something to do with how the MSDE is returning numbers (floats) and Thousand
Separators...
Where do I start to check for these things?
Best regards/
Lars NetzelIt's not the thousands separator. It's the decimal point. In Europe,
you'll see the comma used to mark the decimal point. I'd check the regional
settings on both those boxes.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com
.
"Lars Netzel" <nospam@.doamin.com> wrote in message
news:eW7o2AGBFHA.2428@.TK2MSFTNGP14.phx.gbl...
I have a developer server (which we run ASP.NEt solutions against) it's an
MSDE instance and then we have another "LIVE" server which also has an MSDE
instance.
We are using Crystal Reports to get Reports out of the Databases and the
reports look different when we run them against the servers.
A Total ( in the report) on our Develooper Server shows as 2,00 in the
report but on out LIVE one.. it shows as 200,00 ... so I'm thinking it has
something to do with how the MSDE is returning numbers (floats) and Thousand
Separators...
Where do I start to check for these things?
Best regards/
Lars Netzel|||I have checked the regional settings in the Windows OS on both Servers..
they are identical (Swedish Settings) I'm wondering if there are any
regional settings in teh SQL server itself... and if so where do I find
that?
/Lars
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:%23qxBgiGBFHA.2540@.TK2MSFTNGP09.phx.gbl...
> It's not the thousands separator. It's the decimal point. In Europe,
> you'll see the comma used to mark the decimal point. I'd check the
> regional
> settings on both those boxes.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinnaclepublishing.com
> .
> "Lars Netzel" <nospam@.doamin.com> wrote in message
> news:eW7o2AGBFHA.2428@.TK2MSFTNGP14.phx.gbl...
> I have a developer server (which we run ASP.NEt solutions against) it's an
> MSDE instance and then we have another "LIVE" server which also has an
> MSDE
> instance.
> We are using Crystal Reports to get Reports out of the Databases and the
> reports look different when we run them against the servers.
> A Total ( in the report) on our Develooper Server shows as 2,00 in the
> report but on out LIVE one.. it shows as 200,00 ... so I'm thinking it has
> something to do with how the MSDE is returning numbers (floats) and
> Thousand
> Separators...
> Where do I start to check for these things?
> Best regards/
> Lars Netzel
>
>|||Did you try changing to, say, US? Also, if the SQL Server service is
running on a domain account, log on with that account and check its
settings.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com
.
"Lars Netzel" <nospam@.doamin.com> wrote in message
news:%23ABo9rGBFHA.3512@.TK2MSFTNGP10.phx.gbl...
I have checked the regional settings in the Windows OS on both Servers..
they are identical (Swedish Settings) I'm wondering if there are any
regional settings in teh SQL server itself... and if so where do I find
that?
/Lars
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:%23qxBgiGBFHA.2540@.TK2MSFTNGP09.phx.gbl...
> It's not the thousands separator. It's the decimal point. In Europe,
> you'll see the comma used to mark the decimal point. I'd check the
> regional
> settings on both those boxes.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinnaclepublishing.com
> .
> "Lars Netzel" <nospam@.doamin.com> wrote in message
> news:eW7o2AGBFHA.2428@.TK2MSFTNGP14.phx.gbl...
> I have a developer server (which we run ASP.NEt solutions against) it's an
> MSDE instance and then we have another "LIVE" server which also has an
> MSDE
> instance.
> We are using Crystal Reports to get Reports out of the Databases and the
> reports look different when we run them against the servers.
> A Total ( in the report) on our Develooper Server shows as 2,00 in the
> report but on out LIVE one.. it shows as 200,00 ... so I'm thinking it has
> something to do with how the MSDE is returning numbers (floats) and
> Thousand
> Separators...
> Where do I start to check for these things?
> Best regards/
> Lars Netzel
>
>

Saturday, February 25, 2012

Problem with printing

Hello everybody,

i have used report viewer control in my win app, (c#, .net 2.0) and from msql i get data, fill necessary tableadapters and print report. Everything works fine on my computer, i generate report from template, push Print button in report viewer, Print dialog appears and i print the report by clicking OK.

The problem occurs in another computer, where i launch my app, i generate report, push Print button, and when appears print dialog happen strange things:

1. In print dialog i push "Print" button once, and nothing happens, Print dialog is still on top, then i push second time Print and then i can see that to pages is sended to printer (but my report is only one page). Printer does nothing, in printer schedulles there is no jobs.

2. So i press Print button in report viewer second time, Print dialog appears again, i click Print button nothing happens, then i push second time Print button i can see that 1 page is sended to printer, Print dialog disapear and now printer print my report correctly.

and this mesh is everytime i generate report and want to print it. Printer is installed correctly, i tried newest drivers for it. For example with ms office word everything works fine.

Could it be report viewer bug? what are the ways to find out what is wrong?

I have had the same problems in reporting services. Sometimes it doesn't print, sometimes it does. Sometimes it prints just the one page. Sometimes it prints multiple. I have tried just messing with the margins in the Report Properties menu button. I have found that SSRS doesn't print the report evenly on the page, too, so having compensated by setting the left margin .5 inches less then the right margin it now doesn't print more then one page as often. I don't know if that exact tweek will work for you, but maybe that will give you an idea what to look for. I would assume that most of these things are bugs, but they are not too hard to work around. Good luck!|||

What version of SSRS are you running? Go to http://<server>/ReportServer and note the number in the bottom right. 9.00.1399.00 is RTM (release to manufacturer) and it has known issues printing. There was a hotfix released for what might be your problem, but you should get the latest service pack (SP2) as it rolls up all of the fixes and has been through more testing.

Good luck,

Larry

|||I have version 9.00.1406.00 and it still has some problems with printing. Is this the latest version?|||

Here is a list of build numbers for the various versions of SQL Server 2005 and it indicates that you have a single patch installed (KB 932557) but that is all: 932557) but that is all: http://www.sqlservercentral.com/columnists/sjones/2960.asp

You may well find that applying SP2 will fix your issue.

Larry