|
you could reduce the amount of work executed by taking into account the clipping data that is present in the PaintEventArgs/Graphics. IMO that is worthwhile only in special cases, like complex paintings that need frequent repaints (e.g. as in games, which probably get programmed quite differently anyhow).
|
|
|
|
|
CreateGraphics is temporary. Use e.Graphics and the Form.Paint event instead. You also appear to have a syntax error (two brackets in front of Pens.Red)
|
|
|
|
|
|
i have already saved username,password in login table.if i entered username,password in login_form, valid user only access that form.how will i do.plz help me
|
|
|
|
|
Write a Stored Proc which will accept two params i.e. your entered username and password, then compares it with the database and returns the status (success/failure). Execute this SP for authentication.
Before doing that go to the nearest book store, buy some good book and learn the basics.
|
|
|
|
|
|
demetter wrote: plz give me the code
Firstly, thats not how it works here. You write the code, and when it doesn't work we help with specific problems. Otherwise, you never learn anything.
Secondly, how are we meant to do that without knowing anything about your database - most people on here are not mind readers, although it does help with some of the questions.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
this code i have used.database is msaccess(mdb)
private void btn_login_Click(object sender, EventArgs e)
{
try
{
string UserName,password,txtPassword;
UserName = txt_user.Text.ToString();
password = txt_pwd.Text.ToString();
//Query = "insert into Login (UserName,txtPassword ) values ('" + UserName.ToString() + "','"+ password.ToString() +"' )";
//daSet = dd.ExcuteDataSet(Query.ToString());
//MessageBox.Show("Successfuly Saved..!");
Clear();
if (UserName == ds.Tables["Login.UserName"].ToString())
if (password == ds.Tables["Login.txtPassword"].ToString())
{
MessageBox.Show("correct");
}
else
{
MessageBox.Show("incorrect");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
modified on Friday, April 17, 2009 8:38 AM
|
|
|
|
|
You need to learn a bit about sql before you go any further. Try searching CP for aricles about using access and c#. Do you understand how a database stores data and how to retreive it? It doesn't look like it from the above.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
hi ,
i am using this code to insert a record into data table
objCommand = new OleDbCommand(str, objConnection1);
objCommand.Parameters.Add("@sid", OleDbType.Integer);
objCommand.Parameters.Add("@nm", OleDbType.VarChar, 255);
objCommand.Parameters["@sid"].Value = textBox1.Text;
objCommand.Parameters["@nm"].Value = textBox2.Text.Trim();
objConnection1.Open();
data = objCommand.ExecuteNonQuery();
it works and it display that record in the grid when i reload data grid.
<b>BUT the the record does not store permanently in the table.</b>
IT dose not display that record when i restart the application.
what is the problem...
|
|
|
|
|
What kind of database do you use? MS Access? Did you checked for the AutoCommit-flag? I'm just guessing, but maybe the internal transaction is not committed.
Regards
Sebastian
|
|
|
|
|
Hi after posting this threat i got the solution
in the solution Explorer first i selected the mdb file;
then changed the properties of mdb file.that is
copy to output directory : copy if newer
that's it !!
|
|
|
|
|
Hi
I know generally we add return confirm message at deleting. But I need to do it at uploading. I can not call the return confirm message from the button onclick because I am validating when uploading. so i need the return confirm message after validation
Can any body help?
|
|
|
|
|
Your question is not clear.., for the delete/updation/adding conformation Message box logic is same..,
Use this below code is U R requirement is same as below...
if (MessageBox.Show("Are U Sure???") == MessageBoxButtons.OK)
// upload process here
else
// terminating process here
Thanks
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
Hello,
I have an excel file with a specefic characters, when i read the text from excel and write it on txt file, the text was on ????????, i do this :
<br />
workbook = excelApplication.Workbooks.Open(@"C:\1.xls", 0, false, 5, "", "", false, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "", true, false, 0, true, false, false);<br />
worksheet = (Microsoft.Office.Interop.Excel.Worksheet)workbook.Worksheets[1];<br />
<br />
string cell_nom = "";<br />
object cellObject_nom = null;<br />
<br />
for (int i = 2; i <= worksheet.UsedRange.Columns.Count; i++)<br />
{ <br />
<br />
range_nom = (Microsoft.Office.Interop.Excel.Range)worksheet.Cells[i, 2];<br />
cellObject_nom = range_nom.get_Value(null);<br />
cell_nom = (cellObject_adr5 == null ? "" : cellObject_adr5.ToString().Trim());<br />
<br />
Console.write (cell_nom);<br />
<br />
}<br />
the original text in excel file was Ангел Димитров Мисирджиев ,
Please help me,Thank you verry mutch
|
|
|
|
|
Hello,
I try fot :
<br />
byte[] l = Encoding.Default.GetBytes(cell_nom);<br />
string f = Encoding.UTF8.GetString(l);<br />
MessageBox.Show(f);<br />
<br />
But unfortunatly it doesn't work, there are always ??????????????, help me please, thank you verry mutch
|
|
|
|
|
Hi,
Can i able to change the installation URL without publish
eg;
i already publish to a URL and i need to change the URL with out open the solution or by without clicking publish, Can i give the URL in web.config or some other way?
Is it possible?
Thankyou
YPKI
|
|
|
|
|
hi,
I would like to make a program that deal with algorithm on graphs.
Which control should I use for drawing the graph - the nodes and edges?
Thanks,
Lune
|
|
|
|
|
You've been ridiculed already for asking this in the Lounge, but no one managed to mention how pointless the question is. Google will tell you and so will an article search here. Try c# graph as a subject. I'll leave the complex keyboard skilz and leet copying to you.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
|
I spent a lot of time researching this when I was trying to build an application to plot juggling state graphs.
In the end I decided that laying out the nodes was one of those jobs that's almost trivial for a human but an absolute nightmare for a computer. There are some OK algorithms for laying out the graphs ( a lot come from electronic circuit board design) but they will never work 100% for the task you are trying to achieve. I made the Nodes draggable and then let the user arrange them where they were wanted, it was far less coding effort than trying to auto sort anything more than a trivial graph.
Russ
|
|
|
|
|
here's what i do every now and then
<br />
STEP 1. switch.to.oracle.bat<br />
STEP 2. run unit test against Oracle db<br />
[visual inspection on NUnit user interface after to make sure things are okay]<br />
STEP 3. switch.to.mysql.bat<br />
STEP 4. run unit test against MySQL<br />
[visual inspection on NUnit user interface after to make sure things are okay]<br />
STEP 5. switch.to.mssql.bat<br />
STEP 6. run unit test against M$SQL<br />
[visual inspection on NUnit user interface after to make sure things are okay]<br />
question is, how can i automate this?
dev
|
|
|
|
|
Well write a unit test for each database...
public void TestOracleDB() {
...
}
public void TestMySqlDB() {
...
}
public void TestMSSQLDB() {
...
}
|
|
|
|
|
Hi again,
You could incorporate NUnit's logic in a test app and forgo the NUnit app itself.
I once did a small subset of NUnit; just supporting [TestFixture], [Test] and Assert.AreEqual takes some 100 lines of code, heavily using reflection.
BTW: You would still need a "using NUnit.Framework;" to reuse the types they have defined.
|
|
|
|
|
Hi to all ,
I am using ODBC connection to read from a excel sheet, but i am unable to read the first line of the excel sheet bcoz driver taking it as Header, i have some data in the first row how can i read it. And another problem is that i can not read the numbers from the excel sheet. These two problems i have solved with the OLEDB connection using HDR=No and IMEX=1 but how to solve this problem in ODBC... please Help me.
connectionString i am using :
Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq=E:\newFile.xls;
Thank You
|
|
|
|