I am trying to build a report onto my application using VS2005(Cannot afford to upgrade even though I want to). The idea is to load data from my database into a dataset Item (Named DS_RPT_AssetStructure.xsd) using the table "TBL_AS" inside the dataset. I then have a report viewer (RV_AssetStructure) that links to a report (RPT_AssetStructure.rdlc). Now, when I run the report, I get back the error "A datasource instances has not been supplied for the datasource 'DS_RPT_AssetStructure_TBL_AS'. I have tried just designing the report to link directly to the dataset, and repointing the Datasources, but nothing seems to work. I really need to get this to work. Please can someone assist me.
Here is my code that refreshes the report:
Dim Con AsNew SqlConnection(Startup.TB_Connect.Text)
Dim Cmd AsNew SqlCommand("EXEC sp_Rpt_AssetStructure " & SQL.SetVar(RCM.CB_Reports_AssetStructure_LocationID.Text), Con)
RCM.Cursor = Cursors.WaitCursor
Dim dsAS AsNew DS_RPT_AssetStructure
Dim rs = New DS_RPT_AssetStructure.TBL_ASDataTable
Dim da AsNew SqlDataAdapter("SELECT * FROM rpt_RCM_AssetStructure Order by [AltSeq]", Con)
Catch ex As Exception
MsgBox("Error Running Asset Structure Report." & vbCrLf & ex.Message)
RCM.RV_AssetStructure.LocalReport.ReportEmbeddedResource = "REW.RPT_AssetStructure.rdlc"
RCM.RV_AssetStructure.LocalReport.DataSources.Add(New ReportDataSource("AS", rs))
RCM.Cursor = Cursors.Arrow
The msgbox i have there, is to confirm that my dataset has data, and I can confirm, that I am getting a row count back.
Thanks for the concern Richard, but it is not. The purpose of the SQL.SetVar function turns the whole thing into a string make SQLi harder to do, and then to further prevent it, the code in the SP cannot handle SQLi, and will instead fail with an error msg. Also, the CM_Reports_AssetStructure_LocationID object is also defined as a style DropDownList, so the users are restricted to certain values.
I don't mean to sound rude and ungrateful, but I do appreciate your concern, but right now, I am more concerned about making the report work.
i have a gridview inside repeater that get its rows from db
i can fill both te repeater and the gridview
i need to edit the rows in gridview and submit the result to db
how could i do that pls provide a code
That's a bit extreme just to remove one application. I have added and removed many versions of Microsoft Express editions and never had a problem with the newly installed versions. I currently have C++ 2010, C# 2010 and Desktop 2013 installed and they all co-exist fine.
Hello. Please excuse me for this basic question. We are presented with the option Create directory for solution when creating new solution. How does visual studio know the whereabouts of the all the project files while the .sln is in different ("root folder" is the right term?) folder ? Thanks for any input.
This world is going to explode due to international politics, SOON.
The solution and project folders have a fixed structure when created, and the actual file locations are kept in these files. You can inspect them for yourself to see how and where the details are saved.
I am trying to access the current NUM LOCK setting on a computer running VBA/VB.NET: - Windows 7 - Visual Studio 2010 - Microsoft (Office) Excel 2010
Here is the code:
Public Const _GlobalDefinitions As String = "GlobalDefinitions"
Public Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Integer, ByVal dwExtraInfo As Integer)
Public Const VK_NUMLOCK As Integer = &H90
Public Const KEYEVENTF_EXTENDEDKEY As Integer = &H1
Public Const KEYEVENTF_KEYUP As Integer = &H2
Public InitialNumLockState As Boolean
Public Sub CheckNumLockState(Optional mWriteback As SSWriteback = Nothing)
If InitialNumLockState Then
If Not My.Computer.Keyboard.NumLock Then
keybd_event(VK_NUMLOCK, &H45, KEYEVENTF_EXTENDEDKEY Or 0, 0)
keybd_event(VK_NUMLOCK, &H45, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0)
Catch ex As Exception
If Not mWriteback Is Nothing Then
AddToErrorLog(mWriteback, _GlobalDefinitions & ":" & System.Reflection.MethodBase.GetCurrentMethod.Name.ToString & "> " & ex.Message & ", " & ex.StackTrace, TraceEventType.Error)
The InitialNumLockState variable is set earlier in the process as follows:
The initial reference to My.Computer.KeyBoard.NumLock works fine (and I can query it within a Watch window in runtime) and initializes the InitialNumLockState variable, e.g., True if the NUM LOCK key is ON.
In the second reference to My.Computer.KeyBoard.NumLock, however, I am getting the following error:
'Computer' is ambiguous between declarations in Modules 'GlbSoft.SWB.SS.My.MyProject' and 'GlbSoft.SWB.SS.My.MyProject'.
Note that the error message says the reference is ambiguous because it is present in two modules with the same name. Of course, this is not possible. There is only one project/namespace involved (GSI_SWB_SS/GlbSoft.SWB.SS).
I have tried a number of different approaches, all without success. Does anyone have any ideas or insight concerning this error and what can possibly be looked at in order to resolve it?