|
The first quesiton that should be answered is what is putting those message up?? THEN you can go digging around your code, if necessary.
Youre code doesn't have to do anything with the registry and your final .EXE can still appear to do stuff in there because of how Windows load your .EXE and its dependencies.
|
|
|
|
|
classy_dog wrote: The account that is being used is setup for an applicaiton by using a sql server
login. The account also has some kind of rights to windows.
Not sure what that means. The URL indicates you are using a SQL Server user to log in.
The application cannot be running with that user because it isn't an OS user. Even if the name is the same it is still a different user.
classy_dog wrote: and/or tell me what you think can be wrong?
What happens when you comment out all of the code that accesses the database?
|
|
|
|
|
I will comment out the code that accesses the database. That way I will see if the application still runs.
So you are saying that the application can be passing a different value to the database?
When I debug the application, the information that is passed to the database is obtained from the app.config.
Is there somehow a way for an account that has sql server authenication to also have access to windows? If so, what kind of an access would that be?
|
|
|
|
|
classy_dog wrote: Is there somehow a way for an account that has sql server authenication to also
have access to windows?
A Windows user can have access to a SQL Server database.
A SQL Server user does not have access to windows.
|
|
|
|
|
I wanted ention/ask the following:
1. I did find out that the username and password for both windows and sql server are the same name and value. Basically windows username and password are exactly the same as the sql server login. Could this cause a problem? if so, what would the problem be?
2. Since the value for connecting to the database comes from an app.config file, is there any way to comment out that connection string information and the vale and the application still works? I would think this would be possible if integrated security=true in the app.config file. I would think if integreated security is not set, and a user name and password is supplied, then the sql server login would be true, correct?
|
|
|
|
|
classy_dog wrote: I did find out that the username and password for both windows and sql server
are the same name and value
Which doesn't mean anything. There are two users, in two different contexts and thus they have different access abilities.
classy_dog wrote: Since the value for connecting to the database comes from an app.config file, is
there any way to comment out that connection string information and the vale and
the application still works? I would think this would be possible if integrated
security=true in the app.config file
Phrased awkwardly but presumably if you are asking if you can remove the user/pwd from the connection string and user a windows user instead.
If so then yes.
classy_dog wrote: I would think if integreated security is not set, and a user name and password
is supplied, then the sql server login would be true, correct?
Yes.
|
|
|
|
|
Thanks! you all answered my questions!
|
|
|
|
|
I want develop a electricity billing application for my friend academic practical. So I have lot of doubt in sending / receiving sms in c# application. Can anyone help for this. Kindly help me.
thanking you.
|
|
|
|
|
Research for some sms providers, that give you a web service interface. It is the most practical/easy way.
|
|
|
|
|
If you have the right sms gateway, you will be able to build an application that can send / receive smses.
|
|
|
|
|
1. Find an SMS Provider
2. Research their protocols
3. Write code that uses their protocol
4. Test it
5. Write a API wrapper around 3 and then use that in your application.
|
|
|
|
|
Thanks for your answers. Everything is fine.. Then I there is any possibility to read the sms from nokia pc suite.
|
|
|
|
|
Here a sample[^] for you.
/* LIFE RUNS ON CODE */
|
|
|
|
|
Hello,
I'm having a few issues with my code, i'm following this tutorial http://www.homeandlearn.co.uk/csharp/csharp_s12p6.html Can anyone point me in the right direction. I've included my code below.
The best overloaded method match for 'System.Data.SqlClient.SqlDataAdapter.SqlDataAdapter(string, System.Data.SqlClient.SqlConnection)
<pre lang="c#">Argument 2: cannot convert from 'System.Data.SqlServerCe.SqlCeConnection' to 'System.Data.SqlClient.SqlConnection'
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Game
{
public partial class Form1 : Form
{
public OpenFileDialog dialog = new OpenFileDialog();
System.Data.SqlServerCe.SqlCeConnection con;
System.Data.SqlServerCe.SqlCeDataAdapter da1;
DataSet ds1;
public Form1()
{
InitializeComponent();
}
private void btn_sel_Click(object sender, EventArgs e)
{
dialog.ShowDialog();
MessageBox.Show(dialog.FileName);
loadconnection();
}
private void btn_close_Click(object sender, EventArgs e)
{
Application.Exit();
}
public void loadconnection()
{
con = new System.Data.SqlServerCe.SqlCeConnection();
con.ConnectionString = "Data Source=" + dialog.FileName + "";
con.Open();
ds1 = new DataSet();
string sql = "SELECT * From tbl_games";
da1 = new System.Data.SqlClient.SqlDataAdapter(sql, con);
da1.Fill(ds1, "Name");
con.Close();
}
}
}
|
|
|
|
|
antrock101 wrote: da1 = new System.Data.SqlClient.SqlDataAdapter(sql, con);
You have defined dal to be of type SqlCeDataAdapter .
You cannot assign it to an instance of SqlDataAdapter .
Thus you get an error.
Use one type of data adapter and there should be no error.
|
|
|
|
|
Thank you
I've entered
da1 = new System.Data.SqlServerCe.SqlCeConnection(sql,con);
Which appears to work however it requires a function that contains 2 arguments and i'm not entirely sure what it's trying to reference
|
|
|
|
|
|
I have, but i'm having trouble getting this to work
|
|
|
|
|
And you think we can guess what trouble that is? Please show the exact code you are using and what errors you receive. If you look closely at the link I gave you it shows exactly what parameters are required by the constructor. Have you done it correctly?
|
|
|
|
|
No. You havent done what Abinav suggested to you.
public partial class Form1 : Form
{
public OpenFileDialog dialog = new OpenFileDialog();
System.Data.SqlServerCe.SqlCeConnection con;
System.Data.SqlServerCe.SqlCeDataAdapter da1;
DataSet ds1;
public Form1()
{
InitializeComponent();
}
private void btn_sel_Click(object sender, EventArgs e)
{
dialog.ShowDialog();
MessageBox.Show(dialog.FileName);
loadconnection();
}
private void btn_close_Click(object sender, EventArgs e)
{
Application.Exit();
}
public void loadconnection()
{
con = new System.Data.SqlServerCe.SqlCeConnection();
con.ConnectionString = "Data Source=" + dialog.FileName + "";
con.Open();
ds1 = new DataSet();
string sql = "SELECT * From tbl_games";
da1 = new System.Data.SqlServerCe.SqlCeDataAdapter(sql, con);
da1.Fill(ds1, "Name");
con.Close();
}
}
Try the above modified code.
BTW: are you writing the above program for WindowsCE device?
Jibesh V P
|
|
|
|
|
You're trying to mix and match similarly named classes from System.Data.SqlServerCe and System.Data.SqlClient namespaces. Understand which platform you're targeting and use the appropriate namespace for the platform.
|
|
|
|
|
if (txtdisc.Text ==null)
{
txttot22013 = txtpr22013 + txtpr22014 + txtpr22015 + txtpr22016 + txtpr22017;
Double txtdisc22013 = Convert.ToDouble(txtdisc.Text);
txttot22013 = txttot22013 - txtdisc22013;
txttot.Text = txttot22013.ToString();
}
else
{
txttot22013 = txtpr22013 + txtpr22014 + txtpr22015 + txtpr22016 + txtpr22017;
txttot.Text = txttot22013.ToString();
}
if (txtvat.Text == null)
{
MessageBox.Show("Enter Vat Amount");
}
else
{
Double txtvat22013 = Convert.ToDouble(txtvat.Text);
txtvat22013 = txtvat22013 / 100;
txtvat22013 = txtvat22013 * txttot22013;
Double txtvatinclu22013 = txtvat22013 + txttot22013;
txtvatinclu.Text = txtvatinclu22013.ToString();
}
|
|
|
|
|
There's no loop in that code anywhere. What's your question?
BTW - you shouldn't use Convert.To... to convert doubles - try Double.TryParse instead as it's much more tolerant of invalid values.
|
|
|
|
|
You REALLY need to pick up a beginners book on C# and work through it. There is no loop in any of this code and if statements are not cosidered loops at all.
TextBox.Text will NEVER return null . It's either going to be something that the user typed in or String.Empty , but never null .
|
|
|
|
|
if (txtdisc.Text == null)
{
..
Double txtdisc22013 = Convert.ToDouble(txtdisc.Text);
translates into
Double txtdisc22013 = Convert.ToDouble(null);
That does not make much sense.
|
|
|
|