Monday, March 26, 2012
How to show Crystal report 11 in .NET 2.0
I have Visual studio 2005 standard edition installed in my system. And also crystal report 11 developper version installed.
I am working on a ASP application. How can i load RPT file in to my web pages. can anyone help me in this matter.
I want to create the RPT file at runtime using report designed dll in version 11 and i am doing it success fully.
Now the problem is with loading the rpt file in web page can any one help me in this regard.plz
check this out
http://www.developerfusion.co.uk/show/4266/
how to share variables across packages?
I'm working on a solution in Visual Studio that has 3 SSIS packages, and now I want to add a 4th that needs access to variables defined in one of the other packages. How can I do that?
One way would be to dump out your variables and values to a raw file or db if you prefer. Then any other process from any execution context can access them anytime via a "source connection" to that file...
|||
Kevin,
Have you looked at package configurations at all. You could set parameter values from a table or a parent package variable.
Rafael Salas
|||Rafael Salas wrote:
Have you looked at package configurations at all. You could set parameter values from a table or a parent package variable.
Yes, I intend to set my variables externally, via package configurations. But I don't know what a "parameter" is or how it differs from a variable. And I don't know how to allow my variables scoped to package X to be accessed by package Y -- how do I make package X to be a parent of package Y?
|||Sorry I meant variable...not parameter.
In short, to make X parent of Y; you can use a Execute Package Task (control Flow) in X that would call package Y.
Rafael Salas
Friday, March 23, 2012
How to setup SelectParameters programmatically?
Hi,
I am using Visual Web Developer 2005 Express Edition.
I am trying to SELECT three information fields from a table when the Page_Load take place (so I select the info on the fly). The refering page, sends the spesific record id as "Articleid", that looks typically like this: "http://localhost:1424/BelaBela/accom_Contents.aspx?Articleid=2". I need to extract the "Article=2" so that I can access record 2 (in this example).
How do I define the SelectParameters or QueryStingField on the fly so that I can define the WHERE part of my query (see code below). If I remove the WHERE portion, then it works, but it seem to return the very last record in the database, and if I include it, then I get an error "Must declare the scalar variable @.resortid". How do I programatically set it up so that @.resortid contains the value that is associated with "Articleid"?
My code is below.
Thank you for your advise!
Regards
Jan
/******************************************************************************** RETRIEVE INFORMATION FROM DATABASE*******************************************************************************/// specify the data sourcestring connContStr = ConfigurationManager.ConnectionStrings["tourism_connect1"].ConnectionString;SqlConnection myConn =new SqlConnection(connContStr);// define the command queryString query ="SELECT resortid, TourismGrading, resortHits FROM Resorts WHERE ([resortid] = @.resortid)";SqlCommand myCommand =new SqlCommand(query, myConn);// open the connection and instantiate a datareadermyConn.Open();SqlDataReader myReader = myCommand.ExecuteReader();// loop thru the readerwhile (myReader.Read()){ Label5.Text = myReader.GetInt32(0).ToString(); Label6.Text = myReader.GetInt32(1).ToString(); Label7.Text = myReader.GetInt32(2).ToString();}// close the reader and the connectionmyReader.Close();myConn.Close();
You can try the following, but you may need to change the resotid if it is an integer type.
SqlCommand myCommand =new SqlCommand(query, myConn);
myCommand.Parameters.Add("@.resortid"
,SqlDbType.NVarChar, 10).Value =Request.QueryString("resortid");|||Something like this:
String ArticleID;if (Request.QueryString["ArticleID"] !=null) ArticleID = Request.QueryString["ArticleID"];else// handle bad parameterSqlParameter param =new SqlParameter();param.ParameterName ="@.resortId";param.Value = ArticleID.ToInt32();myConn.Parameters.Add(param);|||
Hi Limno and SGWellens,
Thanks for your help - I managed to get it working like a charm!
Regards
Jan
Monday, March 19, 2012
How to set up my tables
Hi everyone,
I am very new to Sql Server and Visual Basic. I am trying to put together a football game. I need to set up a database full of teams for the game to choose from and match up against one another. I need mulitple teams, each with individual players, positions and ratings. No matter what I do I just cant seem to get this to set up the way I want it to. I want to be able to pick the team from a combobox and the players and ratings for each player appear in the textboxes I have provided. I know this shouldn't be very hard, but I have been stuck on this for months now. Please help!
P.S. I do know how to basically set up a database, assign textboxes to database values and all that. I just basically can't figure out the relationships of tables needed in the database to make this work. Thanks again!
You want 2 tables:
Table 1: tblTeams
-
TeamName Primary Key
TeamID Pimary Key identity
Table 2: tblPlayers
-
PlayerName Primary Key
TeamID
Ratings
Once you have the tables designed, the dropdown can ask the team and display the players or display the player to identify the team.
This will display all players on whichever team is selected
SELECT p.Players FROM tblTeams t
JOIN tblPlayers p on t.TeamID = p.TeamID
WHERE t.TeamName = txtTeam.text
This will display the team that the player is on:
SELECT t.TeamName FROM tblTeams t
JOIN tblPlayers p on t.TeamID = p.TeamID
WHERE p.PlayerName= txtPlayer.text
Hope this helps,
Adamus
|||I'll try that out, thanks.|||Adding to Adam's presentation, if this is a multi-user 'fantasy football' type simulation, you will be presented with multiple users creating 'their' individual Teams. As well as each Team containing multiple Players, A particular Player can exists on multiple Teams.
In that situation, it may be helpful to allow Players to be select to multiple teams, so in addition to Teams and Players, a Team-Player table would likely be useful.
Wednesday, March 7, 2012
How to set MS Access as Data Flow Destination
Hi Bart,
Data flow destination can be used to output to MDB file for Microsoft Access.
In the OLE DB "Connection Manager: Select "Microsoft Jet 4.0 OLE DB Provider" for the Provider field.
Click on the "Browse" Button next for the "Database File Name" property and Select an existing Microsoft Access Database file. and close that window.
In the OLE DB Destination Editor - for the "Name of the table or the view" property click on "New" and it will show the table format for the imported table in access database.
Thanks,
Loonysan
Yes - its possible.
In the "OLE DB Destination Editor" Window - Click "New" for OLEDB Connection Manager.
In the "Connection Manager" Window - Select "Microsoft Jet 4.0 OLE DB Provider".
Select an existing Access Database file using the "Browse" button for "Database File Name and close the "Configure OLE DB Connection Manager" window.
In the "OLE DB Destination Editor" - Click "New" for "Name of the table or the view" - it will show the table structure of the imported data. Make changes to the table / column names if required.
Clcik on "Mappings" and check the default mapping for the imported columns. Click OK.
You should be good to go from here
Thanks,
Loonysan
Friday, February 24, 2012
How to set default date in SQL to
Even if I pass a system.dbnull.value to the table, it keeps showing
a default date of the above. I want to end-up with a <NULL> for the
date entry from my code when a user deletes a date from my
aspx page.
Thanks,You can mix something from:
use a DEFAULT constraint to your date column
use NULLIF() function with an out-of-range date
use ISNULL() function with an out-of-range date
and check that your table supports NULLs in your date column
we also have problems passing nulls via VB6 (must be variants).
Cesar.|||Thanks Cesar,
I saw a KB on Microsoft saying that functionality is a bug but don't see
they fixed it. I will give the ole variant a try. Thanks again.
BobbyJ