|
the company I work wants to use NHibernate as a OR mapper. I know nothing about it. The application will be a rewrite of a web solution using C#.
I've read that there is not much good documentation. Is this true?
Where could I get a simple sample app?
Any help suggestions is apprecriated!
|
|
|
|
|
Google is your friend.
The second hit in this search[^] will help you.
|
|
|
|
|
Hi guys,
I have an application that uses a few tables and a few store procedure for it's functioning. Is there any way I can automate creation of these tables and store procedures within my application by directing it to a certain database on SQL server?
Please advice.
sasa
|
|
|
|
|
If the database already exists you can always connect to it and run your table and stored proc creation scripts with ExecuteNonQuery.
|
|
|
|
|
Got it, thank you very much
sasa
|
|
|
|
|
say you have
create procedure dbo.GetUsers
@Enabled bit
as
select * from tUsers where enabled = @Enabled
now that above code can be set as the command text and which ever database you set as the intial db will have this code executed and a stored procedure call GetUsers will be created.
So if you create a function that loads an .Sql file and reads it, then tells the sqlcommand to execute the code returned from the sql file, which ever database you set as the intial database will have a new table or stored procedure.
Gav
|
|
|
|
|
Hi.i am try to write update statement using classes but it always gives me an error and use this on my form.i did something like this.
public class Update
{
string empname = "";
public Update()
{
//
// TODO: Add constructor logic here
//
}
public void updateEmployee(string empname1)
{
empname = empname1;
SqlConnection conn = new SqlConnection();
conn.ConnectionString = "integrated security=SSPI;initial catalog=Employee;server = za211149;persist security info=False";
conn.Open();
try
{
SqlCommand UpdateEmp = new SqlCommand();
UpdateEmp.Connection = conn;
UpdateEmp.CommandText = "UPDATE jakes";
UpdateEmp.Parameters.Add(new SqlParameter("@empname",System.Data.SqlDbType.VarChar,50,empname));
UpdateEmp.Parameters["@empname"].Value = this.empname.ToString();
if(UpdateEmp.ExecuteNonQuery()==1)
{
MessageBox.Show("record updated");
}
else
{
MessageBox.Show("record not updated");
}
}
catch
{
MessageBox.Show("o a gafa");
}
finally
{
conn.Close();
}
}
-- modified at 9:03 Wednesday 19th July, 2006
|
|
|
|
|
You don't have a proper UPDATE statement. It should be in the form
UPDATE jakes SET [field_name] = @empname
Remember to have a where clause also, unless you want all records updated with this value.
WHERE id = @id
|
|
|
|
|
Mamphekgo wrote: UpdateEmp.CommandText = "UPDATE jakes";
if i'm not wrong you are missing the SET keyword. The above mentioned line should be like this:
UpdateEmp.CommandText = " UPDATE jakes SET
Regards.
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
Hi all
when I was discovering Visual studio .Net 2005, I tried to put about 50 buttons on a form and run the application, but I had got a strange behavior, that is the buttons started to be painted one after another making a feeling of flicking, I tried to many ways to overcome this by using double buffering but still got the problem
??????????
|
|
|
|
|
In such cases you must create custom control with owner draw.
My english is not so good. Please, correct my errors.
Best regards, Alexey.
|
|
|
|
|
I tried to this
I did my own button class that derived from class button and changed its behavior using setStyle Method to enable double buffering and user paint and allPaintingInWMpaint, I did all of this in the constructor of my class but I didn’t overrides the OnPaint Method
And still got the problem
If u don’t mind, can u give me what u advised me in a sample code?
Thx
|
|
|
|
|
I think he meant something different. Instead of creating x separate controls implement on user control which paints all buttons together and also handles the mouse events etc for himself.
ControlPaint.DrawButton will help you doing this.
|
|
|
|
|
Maybe its a system resource issue. I have seen window draw controls individual after heaving thrashing so it is a possibility. 50 buttons could be considered a lot on some systems.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
|
Build the exe of the application and execute it.
Pramod
|
|
|
|
|
Many Thx
Yes this works for release version and run in good state from outside the IDE
|
|
|
|
|
When we have to use arraylist & hashtable?
Mallikarjun
|
|
|
|
|
|
Hi all
I need to declare and initialize the object for another class inside the present class. and how to add tht statement to my existing class using CodeDOM
Thanking you
Mani
-- modified at 6:55 Wednesday 19th July, 2006
|
|
|
|
|
Hi. I have created a thread that calls Thread.Sleep(60000) after doing some work, and then it does some more work.
What I wanted to do is to make the thread to resume processing and not having to wait the 60000ms until the sleep ends.
For example, a function that tests if the thread is asleep, and if so, wakes it up. Is there a way to do this? I tried with the 'Resume' function, but this works only if the thread is in 'suspended' state.
Thanks.
|
|
|
|
|
Try to "Suspend" thread insted of "Sleep".
My english is not so good. Please, correct my errors.
Best regards, Alexey.
|
|
|
|
|
Thanks for the advice, but Suspend just suspends the thread infinitely.
The normal behaviour of the thread should be:
DoSomeWork
Thread.Sleep(60000)
DoSomeMoreWork
But in certain occasions I need to tell the thread to execute 'DoSomeMoreWork' before the sleep ends, that is, tell it to stop sleeping and continue execution.
|
|
|
|
|
Just put it in another thread instead of in main thread. Use some flag, for example "isFinished" or something like that.
DoSomeWork
while(isFinished == false)
{
... waiting...
}
DoSomeMoreWork
|
|
|
|
|
Use timer to manage this situation.
My english is not so good. Please, correct my errors.
Best regards, Alexey.
|
|
|
|