|
My idea is that some people might be more likely to get the idea how a question should look like when they see an examplary one, rather when being told they should be more specific. I'm aware that there's the "How to get an answer"-sticky and that few people actually read it (like in any forum..) but at least then Pete and Griff could just have told him "look at this one, this is how a question should look like" instead of multiple attempts to convey the idea.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Come on, these people are supposed to be professional developers. If they cannot make the effort to do something this simple then they are not likely to last very long.
|
|
|
|
|
I would happily agree with you, but
While these forums might be intended to be used by professional developers to ask questions, to me it seems that the majority of inquirers is very unexperienced. And it seems to be tolerated, otherwise questions like these could be just closed instead of trying to make sense of it. So if it's tolerated, wouldn't it make sense to supply this kind of "illustrative material"?
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Experienced or not, they should possess enough intelligence to describe a problem in proper detail. It's not just about explaining the problem, it's also about making the effort for themselves rather than just posting a vague sentence, or dumping some code and saying "please fix it".
|
|
|
|
|
I completely agree with you. I'm not trying to justify the inquirers of these questions; just presenting an idea that could possibly make everybodys participation here a bit easier. I don't think Griff or anybody else takes enjoyment from repeating himself over and over. The link in Dave's signature is very good.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
See also the link in Dave K's signature below.
|
|
|
|
|
Hey, if you think we are being picking asking you about your code you're not thinking about how picking the computer is! If you can't describe the code and problem to us, you have no hope at all of describing it to computer!
|
|
|
|
|
I created a rdlc report and set background image to it but I can't find a way to make the image fit the page size like A4 or something .. the image is large and resizing it didn't fix the issue
how to set the background to fit the report page
thanks in advance
|
|
|
|
|
Good Day All
i have a Reporting Service URL that i dynamically pass the Parameters on a Querystrng and if i take that URL and post it on a BRowser it downloads the PDF file. so i want to do this in C# , this code runs in a WCF service
public void GetAccountEmailStatement(string AccountNumber, string EmailAddress)
{
try
{
string remoteUri = "<a href="http:
string fileName = HttpContext.Current.Server.MapPath("/Temp/" + AccountNumber + ".pdf");<br />
WebClient webClient = new WebClient();
webClient.DownloadFile(remoteUri, fileName);
}
catch (SqlException ex)
{
throw ex;
}
finally
{
this.con.Close();
}
}
The Error i get when its supposed to download the file is
The remote server returned an error: (401) Unauthorized.
Please help
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vimalsoft.com
vuyiswa[at]vimalsoft.com
|
|
|
|
|
The error message is very clear and explicit: "The remote server returned an error: (401) Unauthorized."
That means that you need to log your downloader in to the site in some way in order to get access to teh files.
I'd suggest you talk to the site owners about the best way to do that!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Hi. I have a form with a rtb and a database with a table. In tabel, I have a column where I have inserted a text. I want like when I run the form, that text to be inserted in rtb and start from a line that I give. I tried like this but unsuccessfully..
string citireLastChapter = "SELECT * FROM cursuri WHERE capitol = '" + SimulatorManager.CursuriCapitol + "'";
SQLiteCommand cmd = new SQLiteCommand(citireLastChapter, Conexiune.getConnection());
cmd.CommandType = CommandType.Text;
SQLiteDataReader read = cmd.ExecuteReader();
while (read.Read())
{
SimulatorManager.ArticolRamasCursuri = (int)read["articol_ramas"];
data = read["date"].ToString();
}
richTextBox1.Text = data.ToString();
lineCount = richTextBox1.Lines.Count();
int row = SimulatorManager.ArticolRamasCursuri;
int col = 33;
richTextBox1.MaxLength = richTextBox1.SelectionLength;
int matchPos = 0;
string[] newLines = richTextBox1.Lines;
if (newLines.Length >= row)
{
for (int i = 0; i < row - 1; i++)
{
matchPos += newLines[i].Length + 1;
}
richTextBox1.Select(matchPos + col -1, richTextBox1.SelectionLength);
richTextBox1.ScrollToCaret();
}
Anyway, code is crap..can you give me some ideas?
|
|
|
|
|
Your code is vulnerable to SQL Injection[^].
NEVER use string concatenation to build a SQL query. ALWAYS use a parameterized query.
const string citireLastChapter = "SELECT articol_ramas, data FROM cursuri WHERE capitol = @capitol LIMIT 1";
using (SQLiteCommand cmd = new SQLiteCommand(citireLastChapter, Conexiune.getConnection()))
{
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue("@capitol", SimulatorManager.CursuriCapitol);
using (SQLiteDataReader read = cmd.ExecuteReader())
{
if (read.Read())
{
SimulatorManager.ArticolRamasCursuri = (int)read["articol_ramas"];
data = read["data"].ToString();
}
}
}
richTextBox1.Text = data;
int row = SimulatorManager.ArticolRamasCursuri;
if (row >= 0 && richTextBox1.Lines.Length > row)
{
int startLineIndex = richTextBox1.GetFirstCharIndexFromLine(row);
int lineLength = richTextBox1.Lines[row].Length;
int col = 33;
if (lineLength > col)
{
startLineIndex += col;
lineLength -= col;
}
richTextBox1.Select(startLineIndex, lineLength);
richTextBox1.ScrollToCaret();
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
modified 15-Apr-15 14:15pm.
|
|
|
|
|
Hmm I see, thank for advice. I reveice:
Additional information: database schema has changed
near "1": syntax error
What that means in my context? The error is on line:
using (SQLiteDataReader read = cmd.ExecuteReader())
I tried to run it with the old code that selects data and it worked. Are there any syntax problems?
|
|
|
|
|
Sorry, looks like SQL Lite uses LIMIT rather than TOP .
I've updated the query in my previous message to:
const string citireLastChapter = "SELECT articol_ramas, data FROM cursuri WHERE capitol = @capitol LIMIT 1";
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thank you very much! Be blessed
|
|
|
|
|
Please help anybody if you know about Web Api
|
|
|
|
|
This is an extremely poor question. When you ask a question, you should be specific about the problem you are facing. Show us what code you have that isn't working, and explain clearly what issues you are seeing.
|
|
|
|
|
In the Object Oriented Debate, is C#.Net a purely object oriented language ? If yes what are the parameters of Object oriented,object based and purely object oriented language ?Please explain with examples.If no give the proper explanation.Thanks
|
|
|
|
|
Yes.
But...we do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.
Try it yourself, you may find it is not as difficult as you think!
If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
HI OriginalGriff I tried to find the answer from web,took help from book and asked to my seniors but you know the answer is contradict to each other.
I feel this may be a great place someone will help me but not sure I may be back with an empty hand
|
|
|
|
|
The idea of homework is that you think about it and form your own conclusions!
So why not explain what you think, justify it and we'll see if we agree? But us just writing it all out for you doesn't help anyone - least of all you.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
|
Can any one tell me best coding practises in c#?
|
|
|
|
|
MSDN is always great place to dig into C#.Net or any .Net compliant languages or technology. Thanks
|
|
|
|
|
There are different "practices" out there. You can use the SOLID principle, you can learn and follow design patterns or the practices of a technology like LINQ, WPF, WCF, ... (by reading the book and following the advice). Personally, I keep everything in an N-tier format (feel free to read my articles 1[^] and 2[^] on that topic) and I like to follow the K.I.S.S. principle and the golden rule of "if it's not broken, don't fix it" see my other article[^]).
The absolute most important rule you should always follow in programming : Stay consistent.
Be it in programming style, naming conventions, commenting style, design style, or whatever ...
Mostly you will not use "one best practice", but rather a mix of several things that just work for you.
Read up on all the key words and find your own way young padawan.
hope this helps.
|
|
|
|