|
As Richard says, the wrong password is the most obvious problem.
Other possibilities are:
1) It's not an SqLite database at all - ".db" is a common enough extension that it could be a different application
2) It's SqLite, but from a different version - check that the DLLs you are using to access it are the latest version, and that you didn't create it in a later application.
If in doubt, it's worth setting up a connection in Visual studio via the Server Explorer pane - if "Connect to Database" doesn't list SqLite then see here: http://stackoverflow.com/questions/19665370/missing-sqlite-data-provider-in-vs-2013[^]
Once you have a working connection in VS, you can get a "good" connection string in the Properties Pane.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I have a new pc and installed new software. Visual Studio 2013 and SQL Server 2014. My old pc had VS 2010 and SS 2012.
Now I have the problem that I created code for working with DTS packages. Worked perfect on the old pc. But the dll is in the GAC of Windows. My new pc has a newer version and won't work. The problem is, that the server where it has to be hosted, also works with the old verion (SS 2012)
I tried to copy the old dll from the GAC and reference it in my new environment, but without luck.
I cannot imagine that I have to install the old software as well on my new pc. I mean, what do you do when your customer has older or newer version in GAC. You must be somehow able to program for that situation.
Anyone any ideas?
|
|
|
|
|
Well, I would suggest you to have a virtual machine on your new PC(VMWare free version). Install all that old software and save the VM on an external drive. This will make it ready to use as and when required.
Your customer will keep coming back to you to get this stuff fixed. This way, you just have to boot your virtual machine and get the job done.
|
|
|
|
|
Hi guys,
I was wondering if there is any impact of the Memory (private working set) towards the performance of the windows services.
I developed a Windows Service program in C#.
Basically what it does is, reading an unstructured text file and then converting it to a structured text file.
File size ranging 1GB to 2GB per file, in multi-threaded.
As what I noted, the higher the Memory (private working set) from the Task manager; it goes, the poorer the program to read and write file.
I already troubleshooting and recode the program in any ways. Still no luck
Any comments to the above, very much appreciated.
Thanks
|
|
|
|
|
Please do not post the same thing in multiple places: it duplicates work and annoys people.
You already have a solution in QA: What to ask: Memory (private working set)[^] so just continue with that one.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Possibly. It depends on how much RAM is in the machine. What's probably happening is that you're getting a lot of swaps back and forth to the page file. Look in Task Manager at the Page Fault and Page Fault Delta columns. You'll probably have to turn these on in the View menu to see them.
Oh, and don't look in Task Manager to see how much memory your .NET app is using. It's lying to you.
|
|
|
|
|
Hello guy as the subject this error shows up and don't know what is the error
Error:System.Data.SqlClient.SqlException (0x80131904): String or binary data would be truncated. The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at _Default.SOrder_Click(Object sender, EventArgs e) in c:\Users\BC 2\Documents\Visual Studio 2013\WebSites\One Touch Service\Default.aspx.cs:line 39 ClientConnectionId:714e7bcb-5bba-41ab-a493-8f7bf33259b9
|
|
|
|
|
And what is your code? Remember that, just because you can see it we can't.
|
|
|
|
|
abdokouta wrote: String or binary data would be truncated.
What's so hard to understand? You're trying to cram too much data into a field that has some hard limit on the size of the data it can hold.
If we can't see your code and table definition we can't really help any more than this.
|
|
|
|
|
this is my code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
RecievedTime.Text = DateTime.Now.ToString();
if (IsPostBack)
{
}
}
protected void SOrder_Click(object sender, EventArgs e)
{
try
{
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Data"].ConnectionString);
conn.Open();
string insertQuery = "insert into OrderData (RoomNumber, OrderCode, Details, ReceviedBy, AssignedTo ,RecievedTime) values (@RNumber, @OCode, @Det, @RBy, @Assto, @RTime)";
SqlCommand com = new SqlCommand(insertQuery, conn);
com.Parameters.AddWithValue("@RNumber", RoomN.Text);
com.Parameters.AddWithValue("@OCode", OrderCode.SelectedItem.Text);
com.Parameters.AddWithValue("@Det", Details.Text);
com.Parameters.AddWithValue("@RBy", Receby.SelectedItem.Text);
com.Parameters.AddWithValue("@Assto", Assto.SelectedItem.Text);
com.Parameters.AddWithValue("@RTime", RecievedTime.Text);
com.ExecuteNonQuery();
Response.Redirect("Login.aspx");
Response.Write("Registration SUCESSFULL");
conn.Close();
}
catch (Exception ex)
{
Response.Write("Error:" + ex.ToString());
}
}
}
and i have great a database called Data and there is table in called OrderData and the connection is Orders
|
|
|
|
|
Check if any of the values you are passing is more than the length of the columns in database.
Siddartha K,
.NET Developer,
Wipro Technologies,
India.
|
|
|
|
|
OK. So are any of the data you're sending to the database larger than the fields in the database?
Your code doesn't say what it's sending, how big, nor do you supply anything on the structure of the table you're updating.
|
|
|
|
|
Hey everyone, I am fairly new to learning c# and I wish to know how to make a C# Script to say when the player hits this collider then the next level starts.
Can you please let me know what I have done wrong in below?
Thanks for you help!
Code I have currently:
using UnityEngine;
using System.Collections;
public class newLevelstarter : MonoBehaviour {
float OnTriggerEnter (){
Application.LoadLevel("Scene2"){
}
}
}
|
|
|
|
|
where is the code for Application.LoadLevel()?
and what is the problem or error?
|
|
|
|
|
I'm not exactly sure what that means. I was hoping someone had the same problem and was able to show me what they wrote to fix it. If not then I need to know how to fix it.
|
|
|
|
|
How to fix what? You have not shown any useful code, or explained what problem you are facing. If you are looking for sample code then you need to look in the Articles section, or try a Google search.
|
|
|
|
|
You haven't posted any code so you have nothing to fix. What you're actually doing is asking someone to write your code for you, that is something completely different.
|
|
|
|
|
I was just trying to find out what I did wrong and for someone to correct it. I'm just trying to make a simple level restarter that when a player hits a collider the level restarts?
|
|
|
|
|
You haven't done anything wrong; the problem is that you haven't done anything. If you have some code that does not work then you need to show it so someone can help you with it. What you have in your original question is not even started.
|
|
|
|
|
this is the code for restarting current level as i found on the net. so put this in any trigger, event , method or anything that want to restart the level. it may work
Application.LoadLevel(Application.loadedLevel);
and also dont put '{}' for method calls just ';'
|
|
|
|
|
I am doing a TCP server & client communication. I would like to display the received data (from client) on the textbox of the server.
When i used txtStatus.AppendText, it works perfectly fine. But when i changed to txtStatus.Text, nothing was shown in the textbox.
I have tried changing to
txtStatus.Text += recMovementData.BaseMoveData.BaseMov.ToString();
but to no avail
It should work as it is the same as .AppendText but it doesnt.
Can anyone help me with this?
This is my code for my server:
private void btnListen_Click(object sender, EventArgs e)
{
//IPAddress ipaddress = IPAddress.Parse(txtIP1.Text + "." + txtIP2.Text + "." + txtIP3.Text + "." + txtIP4.Text);
//int portNum = Convert.ToInt32(txtPort.Text);
IPAddress ipaddress = new IPAddress(new byte[] { 123, 123, 123, 123 });
int portNum = 8500;
TCPServerHelper.AcceptConnection(ipaddress, portNum);
txtStatus.Text = "Connected to remote client!";
while (true)
{
byte[] bufferReceivedData = TCPServerHelper.Read();
MovementData recMovementData = (MovementData)TCPServerHelper.Deserialize(bufferReceivedData);
try
{
//txtStatus.AppendText(recMovementData.BaseMoveData.BaseMov.ToString());
txtStatus.Text += recMovementData.BaseMoveData.BaseMov.ToString();
}
catch
{ }
}
|
|
|
|
|
Are you sure that the += operator is overridden for this property. I notice that you have an empty catch block in your code, which may well be why you don't see anything. There is no point using try/catch if you just ignore any exceptions.
|
|
|
|
|
I have an SQLite database with a column type of BLOB. But, here I inserted a text, because is a very long text and data types TEXT,STRING or VARCHAR does not support such a length. How can I show the text in a richTextBox? The code so far:
using (Conexiune.getConnection())
{
string select = "SELECT * FROM legislatie WHERE capitol = '" + SimulatorManager.LegislatieCapitol + "'";
SQLiteCommand cmd = new SQLiteCommand(select, Conexiune.getConnection());
cmd.CommandType = CommandType.Text;
SQLiteDataReader rdra = cmd.ExecuteReader(CommandBehavior.CloseConnection);
try
{
while (rdra.Read())
{
data = (byte[])(rdra["date"]);
}
}
catch (InvalidOperationException ex)
{
MessageBox.Show(ex.Message);
}
MemoryStream ms = new MemoryStream(data);
richTextBox1.Text = data.ToString();
}
|
|
|
|
|
Your code is vulnerable to SQL Injection[^].
NEVER use string concatenation to build a SQL query. ALWAYS use a parameterized query.
You're calling Conexiune.getConnection() twice, throwing away the result of the first call, and not disposing of the result of the second call.
You should wrap your disposable objects (the connection, command, and datareader) in using blocks.
You shouldn't use SELECT * FROM - state the column(s) you want to load explicitly.
There's no need to use a datareader to select a single value. ExecuteScalar will return the first column of the first row of the query results. You can also add a LIMIT 1 at the end of the query, since you're only looking at a single record.
To convert a byte[] array to a string, you'll probably need to the Encoding class[^]. Which encoding you use will depend on how your data was added to the database.
const string select = "SELECT data FROM legislatie WHERE capitol = @capitol LIMIT 1";
using (SqlLiteConnection connection = Conexiune.getConnection())
using (SqlLiteCommand cmd = new SqlListCommand(select, connection))
{
cmd.Parameters.AddWithValue("@capitol", SimulatorManager.LegislatieCapitol);
cmd.CommandType = CommandType.Text;
var data = cmd.ExecuteScalar() as byte[];
if (data == null || data.Length == 0)
{
richTextBox1.Text = string.Empty;
}
else
{
richTextBox1.Text = System.Text.Encoding.Default.GetString(data);
}
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I see, thank you, it worked
|
|
|
|
|