|
Pete O'Hanlon wrote: I'm not responsible for your scope creep.
Genuine LOL
|
|
|
|
|
In that case...
private void PrintNumbers(int number)
{
if( number == 3 )
{
Console.WriteLine("3 2 1 0 1 2 3");
}
else if( number == 4 )
{
Console.WriteLine("4 3 2 1 0 1 2 3 4");
}
else if( number == 18 )
{
Console.WriteLine("18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18");
}
else
{
Console.WriteLine("Invalid argument");
}
}
|
|
|
|
|
SVb.net wrote: but not use loop at the method and not return any value
I want this nail banged into this drywall, but you're not to use a hammer and you're not allowed to use the end of a screwdriver either!
Whatever will this stupid teachers come up with next?
|
|
|
|
|
J4amieC wrote: I want this nail banged into this drywall, but you're not to use a hammer and you're not allowed to use the end of a screwdriver either!
He could always use his head.
|
|
|
|
|
"For your next assignment, Mr. Norris, you are to apprehend a bad guy without using a roundhouse kick or doing any bodily harm."
|
|
|
|
|
I just checked the C# specification and saw no mention of "loops", so just use an "iteration statement".
|
|
|
|
|
I need a sample code or technique through which I can call SQL Server 2005 stored procedure in a RDLC report in C#. Please help me urgent as I need it plz.
|
|
|
|
|
Send me 100 dollars via paypal urgently plz help omg now plz and ill do it.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
i use C#.net 2005 and datagridView .i need to add button at columns , not as datagridviewbutton.
i can customize columns for my request.
123
|
|
|
|
|
SVb.net wrote: i use C#.net 2005 and datagridView .i need to add button at columns , not as datagridviewbutton.
i can customize columns for my request.
Find the X & Y values of your column, and create a button dynamically. Then set the position of the button to the X & Y of your column. You can do this for each column, or however many times you need it. Just create a new button each time, and load the buttons into an array. Then you will have a collection of all the controls you created.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Hi all,
I have written a small piece of code which splits a text file into "N" number of output files with "X" records each. The code is working fine, But it is unable to handle special characters. When the input file has text like --> "INDUSTRIESTRAßE" It's converting it to
--> "INDUSTRIESTRA?E". I have not included any provision to handle the special characters. How can I change the code so that it doesn't misinterpret these special characters while splitting a file.
This is the code which reads and writes the data.
<pre>
using (StreamReader sr = new StreamReader(input_file_path + "\\" + input_file_name))
{
if (firstLineColumns)
header = sr.ReadLine();
//Ignore the first line if the first line is columns
while (!sr.EndOfStream)
{
fs = new FileStream(target_path + "\\" + target_file_pattern + file_no.ToString() + extension, FileMode.Create);
sw = new StreamWriter(fs);
if (targetFirstLineColumns)
sw.WriteLine(header);
for (int i = 0; i < number_of_lines_per_file && !sr.EndOfStream; i++)
{
sw.WriteLine(sr.ReadLine());
}
sw.Close();
fs.Close();
file_no++;
}
}
</pre>
Here I want to split the input to "N" number of files with the "X" number of lines each.
Please help me out here.
Thank you very much!
You don't have to be AFRAID!
|
|
|
|
|
Hi,
When using StreamReader and StreamWriter you need to set a character Encoding:
... StreamReader sr = new StreamReader(input_file_path + "\\" + input_file_name, Encoding.Unicode) ... (and the same for the writer).
There are other encoding formats aswell.
Hope this helps.
Matthew Butler
|
|
|
|
|
Thank you for your information.
I'll try that and get back to you.
You don't have to be AFRAID!
|
|
|
|
|
Hey folks,
I am currently using the iTunes SDK to extract (save to the local computer) the most recent cover art that has been applied to a track/file by iTunes.
iTunes seems to keep a collection of all cover art applied to the track/file but there seems to be no logical order in the way that the cover art is stored on the collection, i.e. most recent applied at the last index.
My question is; am I missing something in the iTunes SDK that makes this kind of information available?
Thanks, M.
When the game is over the Pawn and the King go into the same box.
|
|
|
|
|
Dear all,
currently i am working with stored procedure , so for each stored procedure i am writing a new function to execute .... there are some procedure those have not have any out parameter
but returning some value like "select * from XYZ" or "select A,B,C from XYZ" or doing like
"select abc_bit as 1" so what should be the return type in all these cases
shall i use sqldata reader ???
Please help me here ... thanks alot...
T@SU
|
|
|
|
|
using (SqlConnection sc = new SqlConnection())
{
StringBuilder sql = new StringBuilder();
sql.Append("exec spYourProc");
string connStr = ".... your string connection here ....";
sc.ConnectionString = connStr;
sc.Open();
using (SqlCommand sco = new SqlCommand())
{
try
{
sco.CommandType = CommandType.Text;
sco.CommandText = sql.ToString();
sco.Connection = sc;
using (SqlDataReader sr = sco.ExecuteReader())
{
YourControl.DataSource = sr;
YourControl.DataBind();
}
}
catch (SqlException exc)
{
}
}
}
SkyWalker
|
|
|
|
|
Thanks alot for ur reply....
here my problem is once am returning the sqldatareader "reader".. to the calling function
if it has only one boolean value how it will read just like am trying to read like...
while (reader.Read())
{
Console.WriteLine(reader["IsNameBit"].ToString());
}
here IsNameBit is set as 0 or 1 from the procedure so how it ll be handled here in code ...
Thanks In Advance
T@SU
|
|
|
|
|
You have a lot of examples here[^]
SkyWalker
|
|
|
|
|
If you have a result that contains a single field in a single row, you can use ExecuteScalar to get the value without having to loop the result.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
hi,Error 1 The type or namespace name 'ApplicationBlocks' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?),how can i solve this problem
asp.net using c#
|
|
|
|
|
|
Hey. First of all excuse my for the Tarzan english.
I wanna get access to a shared folder in a remote host, but will be amazing if could call the Windows Login Dialog[^] (image by google) for grant access permissions. Any ideas?
Sorry if this question is solved before, but i didn´t find it searching.
Thanks for all.
|
|
|
|
|
Hello
Does anyone know how I can access a field from a CrossTab object from code?
I can get the CrossTab object with 'myRPTdoc.ReportDefinition.ReportObjects["CrossTab1"]' but what do I do next?
Thanks
|
|
|
|
|
Hi ,
This is ravindra,currently working on Windows Service.
I implemented the following two methods to call notepad.exe from windows
service,but its not working.So,please anybody help to complete my task.
Method1:
=======
STARTUPINFO si = new STARTUPINFO();
PROCESS_INFORMATION pi = new
PROCESS_INFORMATION();
CreateProcess("C:\\WINDOWS\\SYSTEM32\\notepad.exe", null,
IntPtr.Zero, IntPtr.Zero, false, 0, IntPtr.Zero, null,
ref si, out pi);
EventLog.WriteEntry("After notepad");
}
[DllImport("kernel32.dll")]
static extern bool CreateProcess(string lpApplicationName, string
lpCommandLine,
IntPtr lpProcessAttributes, IntPtr lpThreadAttributes, bool
bInheritHandles, uint
dwCreationFlags, IntPtr lpEnvironment, string lpCurrentDirectory, ref
STARTUPINFO
lpStartupInfo, out PROCESS_INFORMATION lpProcessInformation);
}
}
Method2:
========
EventLog.WriteEntry("In the notepad");
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = "notepad.exe";
psi.UseShellExecute = false;
psi.Domain = "sys43.";
psi.UserName = "Acer OEM User";
SecureString secure = new SecureString();
string password = "nopassword";
foreach (char c in password)
{ secure.AppendChar(c); }
psi.Password = secure;
Process process = new Process();
process.StartInfo = psi;
process.Start();
|
|
|
|
|
System.Diagnostics.Process.Start("notepad");
its me sid
|
|
|
|