|
Code4Null wrote: Is it possible to write app. for symbian by VS2005 and C# or VB.NET?
Yes.
What is symbian?
led mike
|
|
|
|
|
Symbian is most popular Oprating system for many smartphones line Nokia (3250, e50,e70,3650 ....... )
|
|
|
|
|
No, The CLR/CLI have not been ported to symbian to my knowlege.
|
|
|
|
|
Code4Null wrote: Oprating system for many smartphones
Excellent! Then all you need is a .NET Runtime for the OS and you can develop in C#. You got one of those?
led mike
|
|
|
|
|
Well, you can port your C# code to symbian using a tool called AppForge. I haven't tested it myself, but it's quite famous and IIRC you can graba 30 days trial to test it.
If not then you'd have to use Symbian SDK in C++. Unfortunately it doesn't work on C#.
Regards
|
|
|
|
|
Hi,
I want use this code to enter some data to data base
data base is an access data base
rec is an instancce of class include some string data member that you see in code
<br />
private OleDbConnection Conn = new OleDbConnection(<br />
@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=../../../db.mdb");<br />
private OleDbDataAdapter dataAdapter = new OleDbDataAdapter();<br />
Conn.Open();<br />
string cmdText = "INSERT INTO tbl1 (fname, lname, relative,tel, " +<br />
"mobile, b_tel, fax, email, adrs, www, job, user)" +<br />
" VALUES ( '" + <br />
rec.FirstName + "', '" +<br />
rec.LastName + "', '" +<br />
rec.Relative + "', '" +<br />
rec.Tel + "', '" +<br />
rec.Mobile + "', '" +<br />
rec.B_tel + "', '" +<br />
rec.Fax + "', '" +<br />
rec.Email + "', '" +<br />
rec.Adrs + "', '" +<br />
rec.WWW + "', '" +<br />
rec.JobTitle + "', '" +<br />
rec.user + "' )";<br />
<br />
dataAdapter.InsertCommand = new OleDbCommand(cmdText, Conn); <br />
dataAdapter.InsertCommand.ExecuteNonQuery();<br />
Conn.Close();
but in runTime this error occurs :
"Syntax error in INSERT INTO statment"
please help me.
---------------------
Areff Bahrami(KAVEH)
Areff.HB@Gmail.com
---------------------
|
|
|
|
|
Congratulations! That is some of the best looking string concatenation code I have seen in years! Too bad it has a bug in it so you have to crawl through it and find what typing mistake you made. If only there were better ways to execute database queries from code.... wait...
"Alot of the people on this forum are incredibly stupid, thinking that the internet is real" Score: 1.0 in the Soap Box
|
|
|
|
|
Had a similar issue with Access recently, and for unknown reasons, using double quotes would insert where singles wouldn't. Might try that.
Further, you might want to look into parameterized queries for a number of reasons. Easier to work with, much nicer to look at and edit, less prone to error, and much more secure.
string sql = "insert into tbl (Field1, Field2, Field3) values (@Field1, @Field2, @Field3)";
OleDbCommand cmd = Conn.CreateCommand();
cmd.CommandText = sql;
cmd.AddParameter(new OleDbParameter("@Field1", rec.Field1));
cmd.AddParameter(new OleDbParameter("@Field2", rec.Field2));
cmd.AddParameter(new OleDbParameter("@Field3", rec.Field3));
IDataReader idr = cmd.ExecuteReader();
|
|
|
|
|
The reply from BoneSoft is essentially the correct approach (use parameters),
but the example code he provided likely will onmly work with the SqlClient namespace rater than
the OledbClient variation.
For OledbClient, the parameters are signified by using ? placeholders rather than parameter names,
so the sql becomes
string sql = "insert into tbl (Field1, Field2, Field3) values ( ?, ?, ?)";
The rest is still correct, the OledbParameters still require a unique name in the constructor,
but the name is not used, so the parameters must be added in exactly the order they are used
in the sql query.
|
|
|
|
|
Huh, ya learn something every day. Guess I've been pretty successful avoiding OleDb. I just typed that in from thought, I figured somebody would find something wrong with it, just didn't expect that. I'll have to remember that.
Actually, I started typing SqlCommand and had to go back and change it all.
|
|
|
|
|
OleDbParameter has the same constructors, like (string name, object value) , how do you setup your parameters with OleDb then? Just give them any name if it just goes by order?
|
|
|
|
|
BoneSoft wrote: Just give them any name if it just goes by order?
Correct, as long as the names are unique, only order matters. Since the names are still keys in the collection, they need to be unique or you get the unexpected side effect of redefining a parameter...
Kinda sucks, but I guess it's a compatibility thing...
|
|
|
|
|
Maybe because I used too many controls,my application has the phenomenon of flicker.I used SetStyle function like this:
this.SetStyle(
ControlStyles.UserPaint |
ControlStyles.AllPaintingInWmPaint |
ControlStyles.DoubleBuffer, true);
but it seems no use. how can I avoid it?
|
|
|
|
|
according to the documentation you should call UpdateStyles()
after setting the style bits
Luc Pattyn
|
|
|
|
|
I have tried according your advice,but it is no use just as before,my code like the following ,is it right?Maybe I should write it in another way.
public FormRecite()
{
InitializeComponent();
this.SetStyle(
ControlStyles.UserPaint |
ControlStyles.AllPaintingInWmPaint |
ControlStyles.DoubleBuffer, true);
this.UpdateStyles();
mainFormRecite=this;
this.sqlConnection1.Close();
}
|
|
|
|
|
You've said your Form has a huge number of controls on it. Maybe you should do double buffer on the controls too.
|
|
|
|
|
Hi,
In my applications, I usually use LPW_DoubleBufferedPanel instances, where
LPW_DoubleBufferedPanel simply inherits from Panel, while setting the three
style bits in its constructor (the SetStyle method is protected, so you can not
call it from outside the panels).
using System;
using System.Windows.Forms;
namespace LP_Basics {
//################################################################################
///
/// LPW_DoubleBufferedPanel is a panel that uses double buffering to avoid flicker.
///
//################################################################################
[System.ComponentModel.DesignerCategory("Code")]
public class LP_DoubleBufferedPanel : Panel {
///
/// Construct a double buffered Panel.
///
public LP_DoubleBufferedPanel() {
// set 3 bits to get double buffering
SetStyle(System.Windows.Forms.ControlStyles.DoubleBuffer,true);
SetStyle(System.Windows.Forms.ControlStyles.AllPaintingInWmPaint,true);
SetStyle(System.Windows.Forms.ControlStyles.UserPaint,true);
}
}
}
(remark: I don't need the UpdateStyles method here since the Panel's handle has not
been created yet, so the panel is born with the new style settings).
Following your mail, I have tried SetStyles on a form, and it does not work the way you and I would hope. It seems the double buffering characteristic is not inherited by
its children.
So I suggest you start using LPW_DoubleBufferedPanel and the like.
I admit, if you need a lot of different kinds of Controls, this may become cumbersome.
Luc Pattyn
|
|
|
|
|
hi every one
well I'm having a bit of trouble in setting the bacground color of the windows Form I'm trying to make here. I wanna give it a customized color which is from the picture of a form built previously but it doesnt gove any option to make your own color uknow like the way we make a color if we dont find any availabe color appropriate.
thanks in advance...
|
|
|
|
|
This should work out:
_form.BackColor = Color.FromArgb(1,2,3);
-Larantz-
|
|
|
|
|
thanks alot man I really appreciate this.
|
|
|
|
|
You can also just type in the RGB ints seperated by commas in the background property field. You're not required to use the GUI dialog.
|
|
|
|
|
Hi,
I have a user control B put inside the parent user control A.
On the child control B, I have put a combo box and a BindingSource BS1. In
the load event of child control B, I fetch the
values from the database and put in a generic BindingList of NameValueClass.
(given below)
class NameValueClass
{
private int _id;
public int Id
{
get{return _id;}
set{_id = value;}
}
private string _name;
public int Id
{
get{return _name;}
set{_name = value;}
}
}
BindingList<namevalueclass> list = RetrieveComboValuesFromDataBase();
Next I assign the list to datasource of BindingSource BS1 (given below)
BS1.DataSource = list;
combo.DataSource = BS1;
combo.DataMember = "Name";
combo.ValueMember = "Id" ;
I have put a Grid on Parent control A. Now I want to show some detail data
on grid, On changing the combo box value i.e. As soon as the
value in the combo box is changed, I need to fetch corresponding details
from database and display on grid. What is the best
way to achieve the same using the BindingSource.
Regards,
Rajat.
|
|
|
|
|
Not sure where to ask this question, so I will start here since I am using C#.
I finally got an upgrade to Visual Studio 2005. I converted one of my projects over and cleaned up a few things that VS2005 was complaining about. However, not I can not connect to the SQL server database. If I compile the application with VS2003, the connection works fine. But on VS2005 the connection times out on open.
Is there anything different about the SqlConnection object between VS2003 and VS2005?
The connection string is a standard:
Server=...;User ID=...;Password=...;Database=...
(Of course where the ... is filled in with the appropriate data).
It seems to work when the database is on the local computer. I just can't connect to a remote computer...
-- modified at 13:56 Friday 27th October, 2006
|
|
|
|
|
What things did you clean up exactly? Did you move the connection string to a different place in the app config and change the code retrieving the connection string?
|
|
|
|
|
Nothing changed around the SQL connection code. Really only 2 things change: 1) had some classes that needed to override Dispose(). I guess they added Dispose() to the base class. 2) Had to change from .Handle to using the safe handle stuff.
The odd thing is that the connection string works when the application is run on the machine with the database. It just won't connect over the network. And that is using the exact same connection string with the Server name specified.
Right now the connection string is hardcoded. Later on it will be stored in the registry.
|
|
|
|
|