|
I know that DateTime.MinValue is equal to 01/01/01. I think some of the code may have automatically assumed that the year in this string was for the 21th century and added the 20 at the begining of the year. I'd be willing to bet that the region/culture settings on the device on which you are observing the problem are different. So you may need to update your code to either use the neutral culture or to be compatible with other cultures.
|
|
|
|
|
Thank you for you answer. It is possible that, as you said, the regional settings of the device are not the one from other devices. Unfortunately this happens only from time to time, thus there was a code problem that hopefully now is fixed.
|
|
|
|
|
the problem that my code does the update during the same run while iam out and run again i find nothing of the updates i think it's a comminting problem anyway hope anyone help me!!
plz check the code:
public partial class Form1 : Form
{
static SqlCeConnection _connection = null;
public static SqlCeConnection Connection
{
get
{
if (_connection == null)
{
_connection = new SqlCeConnection(ConnectionString);
_connection.Open();
}
return _connection;
}
}
public Form1()
{
InitializeComponent();
}
public static DataSet ds = new DataSet();
public static int rowindex = -1;
private void menuExit_Click(object sender, EventArgs e)
{
Close();
}
#region File & Database Details
static string CurrentFolder
{
get { return Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase); }
}
const string _databaseLocalFileName = "DB1.sdf";
static string DatabasePathName
{
get { return Path.Combine(CurrentFolder, _databaseLocalFileName); }
}
const string _baseConnectionString = "Data Source =";
static string ConnectionString
{
get { return _baseConnectionString + DatabasePathName; }
}
#endregion
private void menuedit_Click(object sender, EventArgs e)
{
rowindex = dataGrid1.CurrentRowIndex;
if (dataGrid1.DataSource != null)
{
panel1.Visible = true;
txtcol1.Text = ds.Tables[0].Rows[rowindex].ItemArray[0].ToString();
txtcol2.Text = ds.Tables[0].Rows[rowindex].ItemArray[1].ToString();
txttblID.Text = ds.Tables[0].Rows[rowindex].ItemArray[2].ToString();
}
else
MessageBox.Show("should load data grid first", "error", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
}
public static SqlCeDataAdapter adap;
private void btnsave_Click_1(object sender, EventArgs e)
{
try
{
SqlCeCommand cmdUpdate = Connection.CreateCommand();
SqlCeTransaction se = Connection.BeginTransaction();
cmdUpdate.CommandType = CommandType.Text;
cmdUpdate.CommandText = "UPDATE tbl SET Col1=@Col1, Col2=@Col2 where tblID = @tblID";
cmdUpdate.Parameters.AddWithValue("@Col1", txtcol1.Text);
cmdUpdate.Parameters.AddWithValue("@Col2", txtcol2.Text);
cmdUpdate.Parameters.AddWithValue("@tblID", txttblID.Text);
if (Connection.State != ConnectionState.Open)
{
Connection.Open();
}
cmdUpdate.Transaction = se;
cmdUpdate.ExecuteScalar();
se.Commit(CommitMode.Immediate);
Connection.Close();
panel1.Visible = false;
menuItem1_Click(null, null);
}
catch (SqlCeException ex)
{
throw ex;
}
}
private void menuLoad_Click(object sender, EventArgs e)
{
try
{
SqlCeCommand com = new SqlCeCommand("Select * from Tbl ", Connection);
adap = new SqlCeDataAdapter(com);
if (ds.Tables.Count > 0)
{
ds.Tables["tbl"].Clear();
}
adap.Fill(ds, "tbl");
dataGrid1.DataSource = ds.Tables[0];
adap.Dispose();
}
catch (SqlException ex)
{
MessageBox.Show(ex.Message);
}
}
}
|
|
|
|
|
Hi i have create following link and i want both link in one line not saperate line.
<mobile:form id="Form1" runat="server"><mobile:link id="lnkHome" runat="server" font-size="Normal" navigateurl="~/Home.aspx">Home
<mobile:link id="lnkLogout" runat="server" font-size="Normal" navigateurl="~/Logout.aspx">Logout
|
|
|
|
|
Hi i want to add selectionlist in mobile:objectlist. I want two label contorl and one dropdown list and a check box on my mobile form as a datagrid control. My code is
<mobile:objectlist id="ObjectList1" runat="server" commandstyle-stylereference="subcommand" labelstyle-stylereference="title" autogeneratefields="False">
<field name="PatientName" datafield="PatientName" title="Patient Name">
<field name="Room" datafield="Room" title="Room">
|
|
|
|
|
Hi can any one help out to automaticall set page according to client mobile screen. i want page to fit according to clients mobile screen. I am unable to set mobile page height widht even.
|
|
|
|
|
if u r developing ur web application in visal studio(MMIT), u dont need to worry abot the screen size of user devices,, this envirnment outomatically detect the user screeen size and auto adjust according to the size.
|
|
|
|
|
Hi
I would like to buy a BlackBerry Bold but I want to be able to create applications for my mobile device. I googled about this and I found some articles.
I think I can develop applications for Blackberry with C# but I need a loader written in Java. Am I correct?
Can anyone help me about this?
Thanks.
|
|
|
|
|
Afraid not. As far as mobile development goes C# is only for .Net. And .Net Compact Framework assemblies are for Windows Mobile (although there is an S60 component that will allow many Symbian phones to run .Net programs).
|
|
|
|
|
Hi There,
How did you get on with this?
Were you able to develop for Blackberry?
If so would you mind pointing me in the right direction as I'm about to learn how to develop Blackberry apps in Java using Eclipse.
Cheers
Johann
|
|
|
|
|
Hi
Is there any one having a VB .Net code to change pocket PC wallpaper in WM 6.0
Please reply
Thanks in advance
|
|
|
|
|
I'm doing so in Windows CE and it's working nice:
Private Const HWND_BROADCAST As Integer = &HFFFF
Private Const WM_SETTINGCHANGE As Integer = 26
Private Const SPI_SETDESKWALLPAPER As UInt32 = 20
Public Sub SetWallpaper(ByVal ImageFileName As String)
Microsoft.Win32.Registry.SetValue("HKEY_CURRENT_USER\ControlPanel\Desktop", "Wallpaper", ImageFileName)
PostMessage(New IntPtr(HWND_BROADCAST), WM_SETTINGCHANGE, SPI_SETDESKWALLPAPER, 0)
End Sub
Hope this helps
|
|
|
|
|
Thanks for reply
But the postmessage is not working
please help
|
|
|
|
|
Can someone please help with a code that can activate auto answering
on a smart phone. Thank you
|
|
|
|
|
What operating system are you using? Windows Mobile, Symbian, ...?
|
|
|
|
|
Hello,
I have a very simple test DB application (VS2008 SP1, CF 3.5 SP1, SQLCE 3.5SP1, C#)that displays a datagrid and fills it with data on load, tableAdapter.Fill, and a button that executes a second time the same command tablaAdapter.Fill.
Deployed on CE 5.0.
1) on WM5.0 emulator works when run from vs2008, debugging (by the way, anyone has an idea on where to find a CE5.0 emulator ready to use under VS2008?)
2) on CE5.0 device works when run directly from the device
3) on CE5.0 device when run from vs2008, with debugging, displays the data, but when I click the button it gives a SqlCeException error on:
<br />
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]<br />
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]<br />
public virtual int Fill(AppDatabase1DataSet.testDataTable dataTable) {<br />
this.Adapter.SelectCommand = this.CommandCollection[0];<br />
if ((this.ClearBeforeFill == true)) {<br />
dataTable.Clear();<br />
}<br />
int returnValue = this.Adapter.Fill(dataTable);
return returnValue;<br />
}
Any suggestion?
Thanks,
Mattia
|
|
|
|
|
Hi!!!
How do i work this camera from WM5
|
|
|
|
|
Hi,
Your query is not clear. but i think you want to start your camera. if yes then try this code.
Dim ccd As New Microsoft.WindowsMobile.Forms.CameraCaptureDialog
ccd.Resolution = New Size(100, 200)
ccd.Mode = Microsoft.WindowsMobile.Forms.CameraCaptureMode.Still
ccd.Mode = CameraCaptureMode.Still
ccd.Owner = Me
ccd.Title = "Take a Picture"
If ccd.ShowDialog() = Windows.Forms.DialogResult.OK Then
If ccd.FileName <> String.Empty Then
PictureBox1.Image = New Bitmap(ccd.FileName)
ccd.Dispose()
End If
End If
May be it helps you.
Thanks
~Khatri Mitesh
khatrimitesh@hotmail.com
Bikaner (Rajasthan)
INDIA
http://www.youtube.com/watch?v=-oJaaPCrk3Q
|
|
|
|
|
Hi
You can easily work with windows mobile camera
on your appliacion add reference of microsoft
using Microsoft.WindowsMobile.Forms;
CameraCaptureDialog cc = new CameraCaptureDialog();
cc.Mode = CameraCaptureMode.Still; // if you wanna take still photos
cc.StillQuality = CameraCaptureStillQuality.High;
put file name as you want to save.
If you need more help reply here
Good luck
|
|
|
|
|
Thanks!
This is code in my simple project
private void menuItem1_Click(object sender, EventArgs e)
{
CameraCaptureDialog ccd = new CameraCaptureDialog();
ccd.Resolution = new Size(100, 200);
ccd.Mode = CameraCaptureMode.Still;
ccd.Owner = this;
ccd.Title = "My Camera";
if(ccd.ShowDialog() == DialogResult.OK)
if( ccd.FileName != String.Empty)
pictureBox1.Image = new Bitmap(ccd.FileName);
ccd.Dispose();
}
it's Ok..
for debug i using device USA Windows Mobile 5.0 Pocket PC R2 Emulator from VS 2008
but this emulator not camera device...
how to add camera?
|
|
|
|
|
on which operating system you are compiling this project ?
You can compile in VS2008 and save the exe in your mobile divice and can run from there put one botton on your Form which will active your camera on mobile device and later can see that on My documents on mobile devie . Hope it helps
cc.DefaultFileName = "Picture .jpg";
cc.InitialDirectory = "\\";
|
|
|
|
|
Hi
Windows Mobile 5.0 Pocket PC Emulator does not provide the camera facility on the emulator. For debug your project on the Emulator you can use the Windows Mobile 6.0 Pocket PC Emulator.
May it solves your problem.
Thanks
~Khatri Mitesh
khatrimitesh@hotmail.com
Bikaner (Rajasthan)
INDIA
http://www.youtube.com/watch?v=-oJaaPCrk3Q
|
|
|
|
|
|
I am developing a Windows Mobile 6.0 application. I need to make the application multilingual.. Is there any built in options available to change language as per our selection..
|
|
|
|
|
The language used on the device is selected through the regional settings. After that setting is changed the device must be reset for the change to take affect. Only then will you be able to see the change in the thread culture and UI culture.
|
|
|
|