Type conversion
CSharp Forum » Database
by patrick
2M ago
C#: declare @calctype int = 5 select @calctype = option from table_1 where optionvar = 'type' Is your grammar correct? ===> (case when (select CAST(option AS int) from table_1 where optionvar = 'type') = 1 then abs(round(dm.value, (select CAST(option AS int) from table_1 where optionvar= 'rawdlen' ) )) else round(dm.value, (select CAST(option AS int) from table_1 where optionvar = 'rawdlen' ) ) end) How do I change it ( initial... Read more ..read more
Visit website
Error when Editing and Deleting in SqLite
CSharp Forum » Database
by titojd
8M ago
hello guys, I'm having a problem deleting and editing a Contest in SqLite, sometimes it works and sometimes it doesn't. Catch: Enter the Try Catch exceptions on Edit: I get the message database is locked I have the following code; My Form C#: private void editar() { if (!string.IsNullOrWhiteSpace(txtConcurso.Text)) { if (txtConcurso.TextLength != 4) { MessageBox.Show("Insira um concurso válido para salvar no... Read more ..read more
Visit website
Format integer with ToString("D2") in SqLite
CSharp Forum » Database
by titojd
9M ago
I'm trying to save my list of numbers with a Zero to the left of the numbers <=9 and it's not having any effect, I'm using the following code in Insert: C#: cmd.Parameters.AddWithValue("@_01", número._01.ToString("D2")); I have the same code on Sql server and it works perfect, would there be another way to do this in SqLite ..read more
Visit website
WHERE date smaller than?
CSharp Forum » Database
by jmcbr2002
1y ago
I have a select in C# and I need the WHERE clause to compare if a particular field in the database has a date smaller than today's Date (less (-) 365 ..read more
Visit website
How to properly open SQL connection with a using statement and do basic data validation?
CSharp Forum » Database
by Automation23
1y ago
Hello! I am new to database testing. I am doing mobile automation and I need to validate sent data in the database. I am trying to write a method that will open the db connection, do some implementation, and then close it. I need a method to return a value but I am stuck with it. So far I have this: C#: public static int GetMemberId(string username){ using (SqlConnection connection = new SqlConnection(Config.connectionString)){ string query = $"select id from memberTable where... Read more ..read more
Visit website
What is the best ORM for dot net core 3.0 or above?
CSharp Forum » Database
by m.abid1985
1y ago
I am using Dapper. Is any other best option rather than Dapper?. Please confirm ..read more
Visit website
Reaching an array inside a MongoDB Collection
CSharp Forum » Database
by Jfisher387
1y ago
Hello, I have a mongoDB collection of orders. Inside each order is a list of items that need purchased. I successfully have saved my orders to a collection. Now I would like to browse through my orders and view the contents of each order.I would of guessed I was able to access the list inside of toolList but doesn't seem to work as expected. Here is what I have currently. C#: private void ordersPage_Load(object sender, System.EventArgs e) { Owner.Hide()... Read more ..read more
Visit website
SQLite Delete data don't work
CSharp Forum » Database
by Kostakis45
1y ago
I'm trying to delete a record from database. Delete_Redord.cs: public void Delete_Info_From_DB() { Plasteka pa = new Plasteka();//Main Form var con = new SQLiteConnection(connection); con.Open(); var cmd = new SQLiteCommand(con); try { cmd.CommandText = "DELETE FROM Description WHERE Mould_Code = '"+pa.Search_Box.Text+"'";//Am I missing something here? BTW Mould_Code is PK integer... Read more ..read more
Visit website
External table is not in the expected format
CSharp Forum » Database
by Anonymous
1y ago
I am trying to upload my excel 2013 file contents to sql server. Here is my code : C#: try { string connectionString = @"data source=DELL\SQLEXPRESS01 ; initial catalog = amen; persist security info = True; Integrated Security = SSPI; "; SqlConnection SQLConnection = new SqlConnection(connectionString); string filename = Path.GetFileName(FileUpload1.PostedFile.FileName)... Read more ..read more
Visit website
How to update one by string field in mongo.
CSharp Forum » Database
by Ant6729
1y ago
I have work logic: C#: var result45 = await _unitOfWork.Deal.UpdateOneAsync( new BsonDocument("_id", "f9097a32-23a7-4242-b34d-1a6d54c17e14"), new BsonDocument("$set", new BsonDocument("totalSum", 9999))); I have nowork logic: C#: var result45 = await _unitOfWork.Deal.UpdateOneAsync( new BsonDocument("_id", dealId), new BsonDocument("$set", new BsonDocument("totalSum", 9999))); I do not understand... Read more ..read more
Visit website

Follow CSharp Forum » Database on FeedSpot

Continue with Google
Continue with Apple
OR