|
I would not have helped you if this had appeared before I replied. How rude. You want instant answers, find somewhere that you can pay for them. If you ask for free answers, 20 minutes is not too long to wait.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
sorry sir i thought that i wud not get my answer.it happens sometimes.from now onwards i will wait for the answer....
|
|
|
|
|
hi want to create the object of crystal report.
for eg:
CrystalReport1 oRpt = new CrystalReport1();
but its not working.shud i add any namespace for this...
|
|
|
|
|
Have you imported Crystal Reports into your project ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
yes sir i have used dataset and have used crystal report.
now i want ot populate my columns through coding.
when i m trying to create the object of crystal report.
its not workin...
i have used this function to bind to crystal report.
public void BindReport()
{
SqlClient.SqlConnection myConnection = new SqlClient.SqlConnection();
myConnection.ConnectionString = "server= (local)\\NetSDK;database=pubs;Trusted_Connection=yes";
SqlClient.SqlCommand MyCommand = new SqlClient.SqlCommand();
MyCommand.Connection = myConnection;
MyCommand.CommandText = "Select * from Stores";
MyCommand.CommandType = CommandType.Text;
SqlClient.SqlDataAdapter MyDA = new SqlClient.SqlDataAdapter();
MyDA.SelectCommand = MyCommand;
Dataset1 myDS = new Dataset1();
//This is our DataSet created at Design Time
MyDA.Fill(myDS, "Stores");
//You have to use the same name as that of your Dataset that you created during design time
CrystalReport1 oRpt = new CrystalReport1();
// This is the Crystal Report file created at Design Time
oRpt.SetDataSource(myDS);
// Set the SetDataSource property of the Report to the Dataset
// Set the Crystal Report Viewer's property to the oRpt Report object that we created
CrystalReportViewer1.ReportSource = oRpt;
}
|
|
|
|
|
I'm not sure this answers my question. What is your compiler error ? Have you imported Crystal Reports into your project ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
i have added namespace:
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
public void BindReport()
{
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["BillingSystem"].ConnectionString);
string str = "Select * From Purchase";
SqlCommand cmd = new SqlCommand(str, conn);
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;
DataSet1 ds = new DataSet1();
da.Fill(ds, "Purchase");
ReportClass cr = new ReportClass();
cr.SetDataSource(ds);
CrystalReportViewer2.ReportSource = cr;
}
Error: cr.SetDataSource(ds);->value cannot be null.
|
|
|
|
|
I'm sorry, I really don't know what else to say. Unless you import the Crystal Reports dll into your project, it doesn't matter what using statements you put in code. Buy an ASP.NET book and read it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
hi..
wat namespace shud i include to create the object of crystalreport.
like:
crystalreport1 cr=new crystalreport();
|
|
|
|
|
<div id="left">
<asp:Menu ID="menu1" runat="server" BackColor="#E5E5CC" DynamicHorizontalOffset="3"
Font-Names="Arial" Font-Size="Small" ForeColor="#000066"
StaticSubMenuIndent="10px" BorderColor="#D7D7FF"
StaticDisplayLevels="2" DataSourceID="SiteMapDataSource1" CssClass="menuitem"
StaticMenuStyle ForeColor="White" CssClass="menuitem" />
<StaticSelectedStyle BackColor="#507CD1" ForeColor="White"/>
<StaticMenuItemStyle VerticalPadding="2px" CssClass="menuitem"
BorderStyle="Solid"
BorderWidth="1px" BorderColor="#000066" ItemSpacing="1px"/>
<DynamicHoverStyle BackColor="#507CD1" ForeColor="White" />
<DynamicMenuStyle BackColor="#E5E5CC" ForeColor="White" BorderStyle="Solid"
BorderWidth="1px" CssClass="DynamicMenu" />
<DynamicSelectedStyle ForeColor="White" BackColor="#507CD1" />
<DynamicMenuItemStyle HorizontalPadding="2px"
CssClass="menuitem1" />
<StaticHoverStyle ForeColor="White" BackColor="#507CD1"/>
</asp:Menu>
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
</div>
This is my code for asp.net menu but border collapse is not working in dynamic menu items , please help.
|
|
|
|
|
hi to all .. i want to make a functionality in which, on mouseover event of a link button or hyperlink a list of categories appears and you should select one category("similar as "http://www.ebay.com/" on categories button )
|
|
|
|
|
Anything dynamic on the client is either AJAX ( which mean javascript ), or just javascript.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Dear all,
How we can fetch clients machine MAC address???
If any idea plz help
Thanx
krishna veer singh
|
|
|
|
|
you mean from browser ??
No I dont think it is possible. You can only detect IP address from ServerVariables.
|
|
|
|
|
ActiveX code example is
<script language="javascript">
function showMacAddress(){
var obj = new ActiveXObject("WbemScripting.SWbemLocator");
var s = obj.ConnectServer(".");
var properties = s.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration");
var e = new Enumerator (properties);
var output;
output='<table border="0" cellPadding="5px" cellSpacing="1px" bgColor="#CCCCCC">';
output=output + '<tr bgColor="#EAEAEA"><td>Caption</td><td>MACAddress</td></tr>';
while(!e.atEnd())
{
e.moveNext();
var p = e.item ();
if(!p) continue;
output=output + '<tr bgColor="#FFFFFF">';
output=output + '<td>' + p.Caption; + '</td>';
output=output + '<td>' + p.MACAddress + '</td>';
output=output + '</tr>';
}
output=output + '</table>';
document.getElementById("box").innerHTML=output;
}
</script>
The above code will work fine for IE.
ASP based code example is as
Copy and paste the two ASPFiles below
The first ASP file- NIC5.ASP
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>WMI Scripting HTML</title>
<script FOR="foo" EVENT="OnCompleted(hResult,
pErrorObject, pAsyncContext)" LANGUAGE="JScript">
document.forms[0].txtMACAddr.value=unescape(MACAddr);
document.forms[0].txtIPAddr.value=unescape(IPAddr);
document.forms[0].txtDNSName.value=unescape(sDNSName);
document.formbar.submit();
</script>
<script FOR="foo" EVENT="OnObjectReady(objObject,
objAsyncContext)" LANGUAGE="JScript">
if(objObject.IPEnabled != null && objObject.IPEnabled !
= "undefined" && objObject.IPEnabled == true)
{
if(objObject.MACAddress != null &&
objObject.MACAddress != "undefined")
MACAddr = objObject.MACAddress;
if(objObject.IPEnabled && objObject.IPAddress(0) !=
null && objObject.IPAddress(0) != "undefined")
IPAddr = objObject.IPAddress(0);
if(objObject.DNSHostName != null &&
objObject.DNSHostName != "undefined")
sDNSName = objObject.DNSHostName;
}
</script>
</head>
<body>
<p>
<FONT color="red"><span
ID="info"> </span>. </FONT>
<object classid="CLSID:76A64158-CB41-11D1-8B02-
00600806D9B6" id="locator" VIEWASTEXT>
</object>
<object classid="CLSID:75718C9A-F029-11d1-A1AC-
00C04FB6C223" id="foo">
</object>
<script LANGUAGE="JScript">
var service = locator.ConnectServer();
var MACAddr ;
var IPAddr ;
var DomainAddr;
var sDNSName;
service.Security_.ImpersonationLevel=3;
service.InstancesOfAsync
(foo, 'Win32_NetworkAdapterConfiguration');
</script>
</p>
<form method="POST" action="NICPost.asp" id="formfoo" name="formbar">
<input type="hidden" name="txtMACAddr">
<input type="hidden" name="txtIPAddr">
<input type="hidden" name="txtDNSName">
</form>
</body>
</html>
*************************
This is the second file. It is an ASP page, but you could change it to
plain HTML and use Java to retrieve the form field values, if you
wanted.
NICPost.asp
<HTML>
<HEAD>
</HEAD>
<BODY>
Network Interface Card Information Page
<BR>
<BR>
<BR>
You are at IP Address <STRONG>
<%=request.form("txtIPAddr")%>
</STRONG>
<BR>
Your MAC address on your network card is <STRONG>
<% =request.form("txtMACAddr")%>
</STRONG>
<BR>
Your DNS Host name is <STRONG>
<% =request.form("txtDNSName")%>
</STRONG>
<BR>
<BR>
<BR>
To confirm your IP and MAC address information, go to
the command prompt and
type in
<BR>
<BR>
IPCONFIG/ALL
<BR>
<BR>
ASP reports that your IP Address is <STRONG>
<%
response.Write Request.Servervariables("REMOTE_ADDR")
%>
</STRONG>which is your external WAN IP address that
anyone can see,
<BR>
but maybe be shared by hundreds of users if you use Net
Address Translation
(NAT)
<BR>
through a common router.
</BODY>
</HTML
Try using the code
|
|
|
|
|
Thanx alot..
let me try with this code..
krishna veer singh
|
|
|
|
|
ActiveX code example is not working with any browser
M using asp.net 2.0.
Where m doing wrong??
krishna veer singh
|
|
|
|
|
Krisha,
If you are looking at the Internet, you're out of luck. TCP/IP is higher in the stack than the MAC (layer 2) and that gets lost in the router once packets are routed out to the internet.
If you are looking at an Intranet, i.e. inside your 4 walls, then you'll need something native on the server that is getting the client request that can bond to and query the network adapter for the machine. That's very low-level however as the public interfaces give you the MACS of your own adapters but you really need to integrate with the router to get the MAC of the routed packets. Somewhere in the system a router maps "MAC x with IP y" and that is where you can make the translations.
What's the background of what/why you need the MAC?
Jeremy
|
|
|
|
|
I need a regular expression validation for the user to enter only numbers from 1 to 4000. It should not be less than 1 or greater than 4000. I used the following expression, but it is accepting 0 and greater than 4000.
ValidationExpression="\d{1,4000}"
any body please help?
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
|
Why do you want regular expression for this??
simply check if number is between 1 and 4000.
|
|
|
|
|
Hi...
you can use "Range Validator" for this
|
|
|
|
|
Search This on Net
|
|
|
|
|
Thank you for your reply. I don't know why you have taken 7 months time to reply for this message, if you really want to answer this question.
This is already resolved.
Anyway, thanks for this very simple but nonsensical reply. Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
i m using access database for my website...........i m a bit confused abt connection string for server....I simply included *.mdb file on my server.....this is what i wrote:-
<connectionStrings >
<add name ="conn" connectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=~App_Data\db1.mdb; " />
</connectionStrings >
is it right....if not then whts right way and if yes then why its not connecting to the database
plz guide me....
|
|
|
|