|
Hi All
Plz Help me
I am new to crystal Report and C#.net
In Last Couple of Day I am Batting with Following Problem , and Solution of this priblem is important for me
I am created crystal Report By using Command SQl ( by selecting ADD Command on the Database Expert-> Create new connection -> Add Command
I have two problem
1) If I Eable the Logon Promt (i.e EnableDatabaseLogonPrompt ="true" )
then following promt is display Before the Report View and Asked for the server passward if i enter passward then Report is Display otherwise not ( It's Happen 1 st time when aplication is run or Session is Exprire) the promt is given below in bold letter
The report you requested requires further information.
___________________________________________________________________
SERVER
Server name: Server
Database name: ERPDB
User name: sa
Password: --------
Use Integrated Security
2) If I disable the Logon promt (i.e EnableDatabaseLogonPrompt ="false")
then following Error Message is Display and Report Can not Display
Logon failed. Details: ADO Error Code: 0x Source: Microsoft OLE DB Provider for SQL Server Description: Login failed for user 'sa'. SQL State: 42000 Native Error: Error in File C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\SalaryReport {4244492D-0548-4110-AF32-9A9E5066CD0E}.rpt: Unable to connect: incorrect log on parameters.
My Actual problem to Display the Report Without Asking Server Passward to User Because User Don't Know the Server Passward
Please any one Help me
Thanks for Your Time
Anil Jagdale
|
|
|
|
|
Dont keep posting the SAME QUESTION again and again. If someone knew the answer they would have provided you with it.
Tarakeshwar Reddy
MCP, CCIE Q(R&S)
|
|
|
|
|
I am attempting to create a more efficient way to select data(like text). Before I used an index to the data that was stored in an array. I would have a separate collection or array that held the indexes of the data in another array. Each index in the "selection array" was selected. I think I have made a more efficient way to do that using two longs per selection, it does not matter how large the selection is, it will always be two longs.
void SelectData(long start, long end)
{
_selected.Add(new Range(start, end));
if (_selected.Count > 1)
RemoveRangeRedundancies();
}
void RemoveRangeRedundancies()
{
foreach (Range rr in _selected)
{
foreach (Range r in _selected)
{
if (rr == r) continue;
if (rr.MinValue >= r.MinValue && rr.MaxValue <= r.MaxValue)
{
_selected.Remove(rr);
continue;
}
if (rr.MinValue <= r.MinValue && rr.MaxValue >= r.MaxValue)
{
_selected.Remove(r);
continue;
}
if (rr.MinValue < r.MinValue && (rr.MaxValue >= r.MinValue - 1) && rr.MaxValue <= r.MaxValue)
{
Range newRange = new Range(rr.MinValue, r.MaxValue);
_selected.Remove(rr);
_selected.Remove(r);
_selected.Add(newRange);
continue;
}
if (rr.MinValue >= r.MinValue && (rr.MinValue <= r.MaxValue + 1) && rr.MaxValue > r.MaxValue)
{
Range newRange = new Range(r.MinValue, rr.MaxValue);
_selected.Remove(rr);
_selected.Remove(r);
_selected.Add(newRange);
continue;
}
}
}
}
Do you think that is a good design?
-- modified at 23:36 Tuesday 26th December, 2006
-- modified at 23:40 Tuesday 26th December, 2006
█▒▒▒▒▒██▒█▒██
█▒█████▒▒▒▒▒█
█▒██████▒█▒██
█▒█████▒▒▒▒▒█
█▒▒▒▒▒██▒█▒██
|
|
|
|
|
I can't seem to get my head around the following.
My Frequency class has two fields Data1 and Data2.
public static List<frequency> ColourFreqCollection = new List<frequency>();
ColourFreqCollection.Add(new Frequency(1,2));
ColourFreqCollection.Add(new Frequency(3,2));etc
Is it possible to now use the IndexOf method to look in the Frequency objects Data1 field and return the index if a particular number exists?
ColourFreqCollection.IndexOf(don't know what to put here! -look in object data1 field and return index if true);
Else what would be the best thing to do?
Thanks in advance for your help.
Haz
|
|
|
|
|
ColourFreqCollection.IndexOf(new Frequency(1,2));
That's all you can do, you don't have a reference to the object you're looking for.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
How to copy and paste a file.
Vasildb
|
|
|
|
|
|
Hi,
Im new to using NCover and NUnit and I have two questions I cant figure out.
I have a project which has 3 classes:
Currency.cs
CurrencyTests.cs
Program.cs
Its a console App. When I use NCover it only details coverage of code in Program.cs (the class with the Main() method). How can I look at the code coverage of the Currency class, or any other one I should add?
My second question is how to set NCover to run my tests, rather than just the main entry point of the program? I am building my tests in the same project.
Thank you in advance,
|
|
|
|
|
To run your test project from NCover you have to do some settings-
1-NCover does not run test cases it uses NUnit for it in your Test project go to -> properties->debug and set start up external project as nunit.exe ( give full path)
2- for command line argument write assembly name of your test project
e.g. testproject.dll
Now when u will run NCover it will start Nunit and Nunit will take your
assembly as project....
Try it
Ethan Hunt 008
"Licensed to Code"
10th Cloud Corp
Banglaore
India
|
|
|
|
|
How can i do check box tick box in .net? I think it is imposibble via using properties.
Thanks for your interesting
|
|
|
|
|
What do you want ? For a check box to show a tick ? You'll need to draw that yourself
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hello;
I mean; is it possible to enlarge check box's tick box,
Thanks
Best Regards
|
|
|
|
|
How is this possible?
protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
{
switch (e.CommandName)
{
case "1":
HiddenField n = (HiddenField)e.Item.FindControl("IDProizvoda");
break;
case "2":
n = (HiddenField)e.Item.FindControl("IDProizvoda");
break;
}
}
In Case"2" how can compiler know that n is HiddenField?
|
|
|
|
|
HiddenField n has been declared before in the same {} block, the one that contains
all the switch cases. This may be counter-intuitive, but it is how C# looks at it.
Luc Pattyn
|
|
|
|
|
Thanks!
|
|
|
|
|
hi,
adding to what Luc Pattyn explained, here is a remark from specification
"The statement-lists of a switch-block may contain declaration statements (§15.5). The scope of a local variable or constant declared in a switch block is the switch block."
please note that a statement-list has obviosly to be in a sequence and reachable.
|
|
|
|
|
This question has already been answered, but I just wanted to add that you can use more curly braces to further delimit the scope of variables. For example:
protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
{
switch (e.CommandName)
{
case "1":
{
HiddenField n = (HiddenField)e.Item.FindControl("IDProizvoda");
...
break;
}
case "2":
{
Hiddenfield n = (HiddenField)e.Item.FindControl("IDProizvoda");
...
break;
}
}
}
In your example it probably doesn't matter, but this certainly comes in handy when case blocks become larger and you want to keep your code partitioned.
|
|
|
|
|
Useful tip Thanks!
|
|
|
|
|
I don't know how to create a file.
txt or inf.
Vasildb
|
|
|
|
|
There are many ways, e.g.
void example() {
string[] strings=Environment.GetCommandLineArgs();
writeStringArray(strings, @"C:\myFolder\myNewFile.txt");
}
void writeStringArray(string[] strings, string fileSpec) {
Directory.CreateDirectory(Path.GetDirectoryName(fileSpec));
using (StreamWriter sw=new StreamWriter)fileSpec)) {
foreach(string s in strings) sw.WriteLine(s);
}
}
Luc Pattyn
|
|
|
|
|
Hallo there! I am trying to set up a simple client - server application for educational reasons and I have a problem resolving the real IP address of my server app. I use the code presented below :
IPHostEntry IPHost = Dns.GetHostEntry(Dns.GetHostName());
label1.Text = "Server IP: " + IPHost.AddressList[0].ToString();
and i keep taking in the label "Server IP: 192.168.2.2" that works locally but if i try it through an external PC in another subnet it doesn't seem to work. And the question is how can i take my real address (which i guess it's the router's address) that is 85.75.1.3?
Thank u in advance!
There is no patch for human stupidity
|
|
|
|
|
patonios wrote: but if i try it through an external PC in another subnet it doesn't seem to work
What kind of error or data are you getting?
patonios wrote: how can i take my real address (which i guess it's the router's address) that is 85.75.1.3
You could use the gateway details if your router is configured as one.
You can also try to use the Tracert(try run->cmd->tracert www.codeproject.com) and adding some logic could fetch you the router address. You may have to find out the last ip address which falls within the private address cat and the next entry to it would be your router address.
Tarakeshwar Reddy
MCP, CCIE Q(R&S)
|
|
|
|
|
Thanks for your response. First of all i want to clarify that when i say it doesnt seem to work i mean that the label's text show my local address 192.168.2.2 and not my real address 85.75.1.3 so i guess if i finish my app it wouldnt be possible to find my server if i put 192.168.2.2 as the server's address.
I can retrieve my real IP address by using me routers settings or using a traceroute app or simply by visiting whatismyip.com but i want to have it dynamically through my C# code. And i was wondering if there is a way using the dns class or another existing class.
i am waiting for more ideas.
Thanks again for your time.
There is no patch for human stupidty
|
|
|
|
|
I have folderBrowserDialog1 and openFileDialog1 .
How to check that the file selected with openFileDialog1 is in the folder selected with folderBrowserDialog1 .
Vasildb
|
|
|
|
|
if (folderBrowserDialog1.SelectedPath == Path.GetDirectoryName(openFileDialog1.FileName)) {}
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|