|
Hi!
I am using a DataGridView component in a simple C# application. I want to suppress the component to be initialized to only have 10 rows and no eleventh row is created what so ever. I have tried but have run out of ideas.
I will appreciate any kind of guidelines.
With thanks in advance.
|
|
|
|
|
I have an application that I was thinking would work much better if it could store it's files in a format similar to the OOXML concept. In other words, pack separate parts into a single ZIP file because it's a PITA to deal with my xml files and the external images that are associated with it.
It looks, to me, like you could use the .NET System.IO.Packaging namespaces to achieve this but I can find any examples that aren't writing something other than an OOXML or XPS file. Does anybody have some pointers on this? Am I barking up the wrong tree?
Cheers!
|
|
|
|
|
|
KaptinKrunch wrote: Have you read this page??
Yes I have. I was hoping to see an example that isn't creating an OOXML or XPS package to save me from any potential pitfalls.
I think I can use it, but I'll need to do some serious surgery on my application and I'll need to think very carefully about how much I should divide my file up and what the relationships should be.
|
|
|
|
|
Hi folks!
I'm coding a very simple Windows Application on VS 2005 (C#) in order to see the records of Customers table of Northwind database.
This Windows Application works fine by "Debugging" on VS 2005 enviroment with "Windows Authentication" to connect to the database.
Now, I thinking to deploy the application, so I created an "Application Role" in the Northwind database.
But, how do I use that Application Role in my application? How do I invoke it?
Can somebody help me?
(Details and reference to step by step guides will be appreciated.)
--
Adrián Córdoba
|
|
|
|
|
|
KaptinKrunch wrote: I'm waiting for the day google does not have the answer.
http://msdn2.microsoft.com/en-us/library/5k850zwb.aspx[^]
KaptinKrunch:
I'm talking about to use "Application Roles" (from MS SQL Server's roles) in my application for connecting to the database. I'm not talking about roles for my applicaton.
In other words, how do I modify my application (now using Windows Authentication) to connect to the database by using an application role that I created in the database (SQL Server Management Studio)?
I saw several sites found by mean Google, but I didn't find a good guide for this purpose.
Anyway, thank you for your answer.
--
Adrián Córdoba
|
|
|
|
|
Can any plz temme dat ..how to put skins/template in winforms (C#'s desktop application )
asd
|
|
|
|
|
Unless you're using WPF, you have to buy it. Period. End of story. That's all she wrote. The fat lady sang already.
First - Buy this.[^]
Then - Read all of it's documentation thoroughly.
After That - come back with code problems (if you have them )
"Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand
|
|
|
|
|
hhani wrote: how to put skins/template in winforms (C#'s desktop application )
You've asked this question before[^] and you were given an answer. Asking the question again will not change the answer.
What don't you like about the answer you were given already?
|
|
|
|
|
Colin Angus Mackay wrote: Asking the question again will not change the answer.
You must not of heard of Heisenberg's uncertainty principle.
|
|
|
|
|
Wjousts wrote: You must not of heard of Heisenberg's uncertainty principle.
Are you suggesting that the OP's brain is so small that it is operating only on the quantum level?
|
|
|
|
|
hey Colin!
So this was week three of my new job and I've been going through code to get familiar with processes. When I went through the SQL code I thought "Colin would have a heart attack. We have credit card numbers and not one SQL parameter." Then we get an email from the dept head reminding us about SQL injection as there have been some banks that have been hacked by SQL injection and to make sure we are using it. I was one of the few who knew about it and showed your article. I've yet to find any protected SQL statements--me thinks I need to talk to the boss.
|
|
|
|
|
leckey wrote: Colin would have a heart attack. We have credit card numbers and not one SQL parameter
Ouch!
leckey wrote: an email from the dept head reminding us about SQL injection ... and to make sure we are using it.
Gosh! I hope that was a typo and not his actual advice.
leckey wrote: I was one of the few who knew about it and showed your article
Fantastic, the more people know about it and how easy it is to protect against it the better the world will be. I've started teaching C# classes this year and I threw out the section on databases and re-wrote it from the ground up it was that bad. Thanks for using my article also.
leckey wrote: I've yet to find any protected SQL statements
I can forsee some refactoring in your team's future.
|
|
|
|
|
Oh, the heart attack comment was not appropriate for you. Sorry about that; I forgot about the medical issue. I hope you didn't take that personally (it sounds like you didn't)!
Yes, that was a typo!
I've already looked at refactoring when I found out a daily file process takes 45 minutes to run. It's part VB script and not using basic optimization tools. So many if loops one record can go through 10 if statements. Some are useless because the statement could never happen based on outer conditions.
Have you thought about publishing a book on SQL injection using real world examples of companies that got hacked?
|
|
|
|
|
leckey wrote: Oh, the heart attack comment was not appropriate for you. Sorry about that
Don't worry about it. I've never actually had a heart attack, although I do have heart failure.* I didn't take it as an inappropriate comment.
leckey wrote:
Have you thought about publishing a book on SQL injection using real world examples of companies that got hacked?
Although I'm keen to write a book, or at least a chapter or two of a book, I've not thought about SQL Injection Attacks as a topic. I've not actually done much with SQL Server recently and I'm concentrating more on LINQ these days. Having said that, I still do the occasional talk on SQL Injection Attacks if invited.
* I guess a heart attack is a form of heart failure. What I have currently is called Reduced Left Ventrical Function which is the byproduct condition of Transposition of the Great Vessels (or wonky plumbing around the heart as it was once explained to me). The blood flows round the body in a figure 8 with the heart at the cross over point. I was born with two figure 0s. The TGV was corrected when I was an infant, but the condition was such that the doctors couldn't correct it fully back to normal, so basically my heart runs the wrong way round. It freaks doctors and nurses out who don't realise this as they think they've connected me up to the ECG (or EKG) machine wrong. My ECG looks upside down compared to a normal person.
|
|
|
|
|
I remember you discussing the issue before; that's why I felt bad when you said "ouch" because I felt like I poked the bear, so to speak. So your Q-T rhythm is reversed? Yeah, that would be freaky! My late father died of a heart attack so I am very hyper-sensitive about heart issues now. I actually have a recurring abnormal-normal arythmia (heart beats abnormally, but the beat itself is regular; it comes and goes and the doctors don't know what causes it although I know if I have consumed too much niacin it kicks in) yet that didn't scare me much.
I should see if the next time you are in the US if my company would be willing to book you for a talk. I still think you should do a book; I don't know of anyone who learns about SQL injection in college.
|
|
|
|
|
First, read this: How to get an answer to your question[^]
Second, don't double post. You have already asked this question and your question has already been answered. If you need more clarification reply to that post
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
What is wrong with the answer you got before? Reposting the same crap over and over doesn't get you anywheres except angering people...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
hi
i write this code to define a method :
CodeMemberMethod method_getData = new CodeMemberMethod();<br />
method_getData.Attributes = MemberAttributes.Public;<br />
method_getData.Name = "GetData";<br />
method_getData.ReturnType = new CodeTypeReference(typeof(DataTable));<br />
ctd.Members.Add(method_getData);<br />
<br />
CodeParameterDeclarationExpression method_getData_p1 = new CodeParameterDeclarationExpression(typeof(System.Data.SqlClient.SqlCommand), "cmd");<br />
method_getData.Parameters.Add(method_getData_p1);
in body of my method, i want to daclare some variables and create new instatnce of it's class and assign value to it, like this :
SqlConnection con = new SqlConnection(this.ConnectionString);
but, how to do this ?
thanks
|
|
|
|
|
|
Dear friends,
I'm doing the console application to listen the call information from our telephone exchange and calculate the bills. Below is the function to listen the calls and save. I'll explain the process.
1) Getting string Data from the exchange through TCP/IP.
2) Split the string and calculate call cost according to the data available in database.
3) save the calculated values in a database
4) write the calculated data in console window.
The above process is happening in round trip. Some times the SaveData(clientDataInString); function is taking more time(more than 10 sec) to complete. Mean time the exchange is sending the data for more than one call. so while receiving the data from the exchange next time i'm getting the concordinated string with more than one calls information. I cannot reduce the time of SaveData function. So i want to do the SaveData process in asynchronous manner or multi thread. Can any one help me please.
#region "Listern"
private static void Listern()
{
try
{
if (strServer == string.Empty)
{
Console.Write(" Enter server name/address: ");
strServer = Console.ReadLine();
Console.Write(" Enter remote port: ");
strPort = Console.ReadLine();
}
Console.Clear();
//IPEndPoint ipEnd = new IPEndPoint(IPAddress.Parse("10.148.146.43"), 5656);
IPEndPoint ipEnd = new IPEndPoint(IPAddress.Parse(strServer), Int32.Parse(strPort));
Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP);
sock.Bind(ipEnd);
sock.Listen(100);
Socket clientSock = sock.Accept();
byte[] clientData = new byte[1024];
NetworkStream ns = new NetworkStream(clientSock);
while (bActive)
{
int receivedBytesLen = ns.Read(clientData, 0, clientData.Length);
string clientDataInString = Encoding.ASCII.GetString(clientData, 0, receivedBytesLen);
ns.Flush();
// the loop should not wait if the function is getting delay. It has to just call this function and go to listen next call info immediately. for the next call info the function should start another thread.
//Save in sql server
SaveData(clientDataInString);
}
ns.Close();
clientSock.Close();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Application.Run();
}
}
#endregion
|
|
|
|
|
|
inside my datagrid i added a Boolean column, the problem is that when i click the checkbox inside the datagrid it doesn't display checked but only when i leave to another check box
please somebody help
here is the code :
DataGridBoolColumn boolColumn = new DataGridBoolColumn();
boolColumn.MappingName="Mapped";
boolColumn.AllowNull=false;
boolColumn.Width=50;
boolColumn.AllowNull = false;
boolColumn.ReadOnly=false;
boolColumn.HeaderText="Mapped";
GridTableStyle.GridColumnStyles.Add(boolColumn);
|
|
|
|
|
michael_jhons wrote: when i click the checkbox inside the datagrid it doesn't display checked
Where is it not displaying? In the debugger, another column in the datagrid? I feel this information is vital to produce a correct response to your question.
Just because we can; does not mean we should.
|
|
|
|