awesome :laugh:
~ Bizarre what men fin attractive ~
awesome :laugh:
~ Bizarre what men fin attractive ~
your code worked fine! Now i just need to check it few more times, because after i delete few items it gets again the null reference exception thank you :) ;)
~ Bizarre what men fin attractive ~
I tried to only remove the item, but the program still executes the selectindexchanged statement. I get the error NullRefefenceException.
~ Bizarre what men fin attractive ~
Hi Does anyone know how to delete an item in a ListBox and then, select the next one or previous one in the listbox? Currently, I was using the next code:
int index = listBox1.SelectedIndex;
listBox1.Items.RemoveAt(index);
Reestablecer();
int cuenta = listBox1.Items.Count;
if (index < cuenta)
{
index++;
listBox1.SelectedIndex = index;
}
else
{
index--;
listBox1.SelectedIndex = index;
}
but i have a event on SelectedIndexChanged on the ListBox, so when I delete the item in the listbox, automatically the code on the SelectIndexChanged is executed and i get errors because the value of the property listbox.selecteditem is null. Any ideas of how to solve it? thanks in advance. :((
~ Bizarre what men fin attractive ~
Hi, I'm developing a device application in C#. I'm currently using a connection string that requires the data source and I'm using the database server name.
String RDAOleBDConnectionString = "Provider=SQLOLEDB;Data Source=" + NombreServidor + "," + Puerto + ";Integrated Security=SSPI;Initial Catalog =" + NombreBD + ";";
But I want to use the IP of the server as the Data Source, I tried to use it but it didn't work. Also, when I'm running my application, when i try to synchronize the device and the server, I have to delete first the SQL tables because shows an error (the table already exists) when I try to get the last update in tables from the server. Also, I haven't tested the application when I try to send the data to the server. Will i have to delete the table on the server? Or there is another way to send and receive data to the server and device without deleting tables? The reason I don't want to delete tables is because i have a website solution manipulating this data and it can delete some of the data the device sent for different reasons, and i don't want to send data that it's already useless when the device syncs again. thanks.:confused:
~ Bizarre what men fin attractive ~
Hi, i'm developing a Pocket PC Application. I am working on security issues, so i was wondering if there is any way to modify the connection string: adding the ip of the server instead of the server name. The application is working with this string:
String RDAOleBDConnectionString = "Provider=SQLOLEDB;Data Source=" + NombreServidor + "," + Puerto + ";Integrated Security=SSPI;Initial Catalog =" + NombreBD + ";";
to something like this:
Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;
i tried to use the last one but i got errors about the provider. thanks for any help
Yes, i closed all the connections before deleting the database. :((
Hi any ideas of how to do this? I have data in a MDB, and i want to import the data to a SQL Database I need to upload it in a ASP.Net page coded in C#, copy to the SQL Server and then, delete the file. Any ideas? I tried some code and make it work, but gives me an error when i try to delete the file (it says that the file is being used for other process). So i want to know if there is another way to do this. thanks :laugh:
I put the break points, and step into the code but still, not working. While I run it in the emulator, it adds the data to the mobile database, but after i stop the debugging and restart the application, the data is lost. Any other idea? :((
Hi, i'm new in this forum. I am currently developing a Pocket Application using C# & SQL CE. Now, everything was working fine until just now. When I do any type of operations in the database (insert, update & delete) running the application in the device everything goes right, no errors. But When I check the database, no changes has been made. It seems that everything is working but I do not know if I'm missing something. I didn't noticed this until i was testing my RDA functions, when i realized that the tables didn't have any data of the SQL Server, any idea of how to solve this? this class creates connections to the SQL CE database.
using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlServerCe;
using System.Data.SqlClient;
using System.Windows;
using System.IO;
using CAPocket.Clases;
namespace CAPocket.Clases
{
class Data
{
String cadenaCon;
public Data()
{
cadenaCon = @"Data Source =\Program Files\CAPocket\Sistema.sdf;SSCE:Database Password='pam653045';";
}
public SqlCeConnection GetConnection()
{
SqlCeConnection con = new SqlCeConnection(cadenaCon);
try
{
con.Open();
return con;
}
catch (SqlCeException ex)
{
return null;
}
}
public SqlCeDataAdapter getAdapter(String s\_sql)
{
SqlCeDataAdapter adp;
try
{
adp = new SqlCeDataAdapter(s\_sql, cadenaCon);
return adp;
}
catch (SqlCeException ex)
{ return null; }
}
}
}
This code block of a class allows the administrator to add, delete or get all the users registered in the application:
using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlServerCe;
using System.Data.SqlClient;
using System.Windows;
using System.IO;
using System.Data;
using CAPocket.Clases;
namespace CAPocket
{
class GestionUsuarios
{
public GestionUsuarios()
{
}
Data cex;
SqlCeConnection cnn;
SqlCeCommand cmd;
//Agrega un nuevo usuario al sistema
public bool NuevoUsuario(String user, String pass, String tipo)
{
cex = new Data();
cnn = cex.GetConnection();
if (cnn != null