|
Santa's Little Helper wrote: (Mods please delete if I have broken any rules, Sorry!)
Whehe, yeah, just post blindly and let the mods clean up after you.
You should have posted in the collaboration-section, the menu is on the left side of your screen
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I know, but I wasn't too sure, and didn't want to offend anyone.
Thanks, I will try that section as you suggested.
|
|
|
|
|
Hi, I have MS Visual Studio 2010 and I program in C#. I need a good looking, prebuilt UIs for my entire application. If you know some resources I'll be glad if you tell me. Thanks.
|
|
|
|
|
Web, Windows Forms, WCF? Resources for each can easily be found by searching on google. You are probably not going to find prebuilt UIs, however, as each application will present its own set of challenges and customization. After all, if all the UI's were to be prebuilt and existing, then the underlying application is likely to have been built along side it and you would be able to purchase or download the complete application negating the necessity for you to write it in the first place....
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
You're right but I'm too close to the end line of the project. Therefore I didn't have another choice cause of lack of time. Thanks, by the way
|
|
|
|
|
You haven't said what the application does, or what technology it is. This may seem minor to you, but it will affect the answers you get if you don't provide vital information.
|
|
|
|
|
The application itself is based on WinForms. I needed an alternative for buttons, message boxes and so on. Now, I, by myself, have found Telerik RadControls pretty useful, finally after too much googling
|
|
|
|
|
atoi_powered wrote: I, by myself,
That is because you asked for an entire UI, you should have asked for a control suite. Telerik is a good choice, there are quite a few others out there as you have no doubt found.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
As CodeProject doesn't have a telepathic interface installed yet, you would have to find this out for yourself. The moral here, if you want useful help, ask a decent question.
|
|
|
|
|
I am looking for good example or articles where Database programming with all operations on multiple tables is depicted using Isolated Storage.
Please suggest some good articles.
|
|
|
|
|
|
SqlConnection conn = new SqlConnect(
"Integrated Security=SSPI;Data Source=DBSRV1;Initial Catalog=master");
SqlCommand cmd = conn.CreateCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "sp_attach_db";
cmd.Parameters.Add("@dbname", SqlDbType.NVarChar, 128).Value = "MyDB";
cmd.Parameters.Add("@filename1", SqlDbType.NVarChar, 260).Value =
@"C:\Program Files\Microsoft SQL Server\MSSQL\Data\MyDB.mdf";
cmd.Parameters.Add("@filename2", SqlDbType.NVarChar, 260).VAlue =
@"C:\Program Files\Microsoft SQL Server\MSSQL\Data\MyDB.ldf";
try
{
conn.Open();
cmd.ExecuteNonQuery();
}
finally
{
conn.Close();
}
This is OK but i need to get the DataBase Name and File Name from TextBox,i Tried but its not working any Help
|
|
|
|
|
pranee24 wrote: i Tried but its not working any Help
Without seeing some of your code we cannot begin guess what is not working.
|
|
|
|
|
pranee24 wrote: i Tried but its not working
Does not tell anyone what you tried or why you think it's not working.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
modified 12-Jul-12 14:39pm.
|
|
|
|
|
Why is your message type "General" rather than "Question"?
pranee24 wrote: i need to get the DataBase Name and File Name from TextBox
1. So you shouldn't be using string literals then, rather use string variables, load them from the textbox(es), and feed them to your SqlCommand parameters.
2. Are you sure you want the users to have the liberty to enter anything they like? When I need access to a small number of databases, I tend to offer a choice (say a ComboBox), and have basically a switch in my code.
pranee24 wrote: its not working
interesting.
|
|
|
|
|
try this:
string dbName = txtDbName.Text.Trim();
string fileName1 = txtFileName1.Text.Trim();
string fileName2 = txtFileName2.Text.Trim();
SqlConnection conn = new SqlConnect(
"Integrated Security=SSPI;Data Source=DBSRV1;Initial Catalog=master");
SqlCommand cmd = conn.CreateCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "sp_attach_db";
cmd.Parameters.Add("@dbname", SqlDbType.NVarChar, 128).Value = dbName;
cmd.Parameters.Add("@filename1", SqlDbType.NVarChar, 260).Value = fileName1;
cmd.Parameters.Add("@filename2", SqlDbType.NVarChar, 260).Value = fileName2;
try
{
conn.Open();
cmd.ExecuteNonQuery();
}
finally
{
conn.Close();
}
Note: Assuming user sending required/valid data from the above textboxes
|
|
|
|
|
Hello members,
I am developing Asp.net website application with framework 4.0 in Visual studio 2010. I would like to convert App_Code to single DLL which contains class files and dataset. Is it possible? Please give your suggestions
Thanks
modified 13-Jul-12 1:24am.
|
|
|
|
|
yes you can make DLL file of all the classes. this will help you to protect your code from others
hope dis link will help you
http://www.c-sharpcorner.com/uploadfile/mahesh/dll12222005064058am/dll.aspx
|
|
|
|
|
Just build the web app. That will already copy it into a single dll. You don't need to do anything special.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
hello
I whould like to convert the requete execute reader to liste:help me please.
this me requete:
System.Data.SqlClient.SqlCommand comm = new System.Data.SqlClient.SqlCommand("SELECT libelle_titre FROM titre", ConnectBase.getinstance().Connection());
List<int> liste= new List<int>();
affiche_titre = comm.ExecuteReader();
while (affiche_titre.Read())
{
liste.Add(Convert.ToInt32(affiche_titre["libelle_titre"].ToString()));
titre1.Text = liste[0]ToString();
titre2.Text = liste[1].ToString();
titre3.Text = liste[2].ToString();
thanks
|
|
|
|
|
Uh ... what's the question? You're already moving the results into a list.
|
|
|
|
|
my question hwo to execute my requete in the list and
any result in the texBox :
example:
..............
..................
System.Data.SqlClient.SqlCommand comm = new System.Data.SqlClient.SqlCommand("SELECT Title FROM titre", ConnectBase.getinstance().Connection());
rs = comm.ExecuteReader();
while (rs.Read())
string []tab = rs.ToString()
texBox1.Text= tab[0];
texBox2.Text= tab[1];
texBox3.Text= tab[2];
......
...
Thanks
|
|
|
|
|
I hate to criticize someone who has asked for help but this anti-pattern needs to stop. I am referring to:
<br />
Convert.ToInt32(affiche_titre["libelle_titre"].ToString());<br />
Data reader values already contain the object type. Look it up from the query. As for accuracy, the code doesn't seem wrong, unless you didn't bother to open your connection. My patter for this would be:
<code>
using(SqlConnection connection = new SqlConnection(connectionString){
connection.Open();
SqlCommand command = connection.CreateCommand();
command.CommandText = "your sql statement";
using(SqlDataReader reader = command.ExecuteReader()){
while(reader.Read()){
list.Add((Int32)reader[0]);
}
}
}
</code>
|
|
|
|
|
Even slightly more elegant would be:
using(SqlConnection connection = new SqlConnection(connectionString)) {
connection.Open();
using (SqlCommand command = new SqlCommand("your sql statement", connection)) {
using(SqlDataReader reader = command.ExecuteReader()){
while(reader.Read()){
list.Add((Int32)reader[0]);
}
}
}
}
as SqlCommand also implements IDisposable, and offers a constructor that takes both the SQL statement and the connection.
|
|
|
|
|
I omit the using on SqlCommand for brevity since its sole function is to close the connection. However, on the data reader, there are times when you want to re-use the command but you can't re-use a command with an open reader. This lets it be much, much easier to not have to fix that bug.
With regard to the constructor, it is matter of taste and I will never fault anyone for using it. Unfortunately, I a lot of my code is left to be maintained by others. I like to think that the brilliance in the code I write is not only in its function but in the ability to line-by-line debug without any surprises.
In my younger career I used to use stored procedures exclusively. I have now moved to embedding the SQL statments in the source files for easier version control. With this, sometimes comes complex dynamic sql statements. (Especially, when reading from SQL Server and then Selecting from Oracle, ugh) with a monstrosity like that, I really don't want to use the constructor because then you have to step into a method in a constructor to see what it does when stepping over an examining the results is so much easier.
Finally, and I never use it, don't forget the option to immediately close the command in command.ExecuteReader().
<br />
command.ExecuteReader(CommandBehavior.CloseConnection);<br />
Really, there are so many great ways to write good clean code using data readers over the hide-and-seek approach that so many ORM's use that I am surprised more developers don't just go back to the basics. I have spent more time debugging one bug in Entity Framework than in debugging every line of the code we are discussing ever. (Ok, that is hyperbole but you get my drift)
|
|
|
|