|
3 people tried to nudge you in the right direction and you downvoted all of them. You still haven't given us the exact error.
We're all volunteers and we're being very polite in trying to help you. If you called up tech support and said "I'm getting an error on my computer." of course the first question will be, "What is the error?"
Same thing in an online forum. If you ask us how to fix an error, then tell us the error. There are 42,654,344 possible errors so we can't possibly guess which one you are getting. Plus, the error probably tells you exactly what is wrong and if you would just read it, you probably wouldn't even need our help.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
ohk cool bro
am new here ,In a hurry i forget it happens sometime
sorry
next tym i will keep this in mind
thanks for going through my code
|
|
|
|
|
issue is solved now thankss i will keep ur suggestions in my mind, but you should tell in descent way
|
|
|
|
|
LOKENDRA YADAV wrote: issue is solved now Good. Glad to hear it.
LOKENDRA YADAV wrote: , but you should tell in descent way I think all 3 of us were very polite. Sorry if you felt different.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hi,I want to make demo on SQL server,but I want to ask one question while making demo I have to mention only theory concept or code in them also???Can any one help???
|
|
|
|
|
|
You'll have to do some code unless you want to only demo features that don't require any code.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
SQL Server 2016 LocalDB installed, and instance 'FFw1a' is created and running:
C:\Program Files\Microsoft SQL Server\130\Tools\Binn>sqllocaldb i Ffw1a
Name: FFw1a
Version: 13.0.2151.0
Share name:
Owner: MinKyung\icey.dong
Auto Create: No
Status: Running
Start Time: 2017/3/3 16:48:38
Pipe name: np:\\.\pipe\LOCALDB#E10BE0E6\tsql\query
I want to create a local db file by below C# code:
private void CreateDatabase()
{
System.Data.SqlClient.SqlConnection tmpConn;
string sqlCreateDBQuery;
tmpConn = new SqlConnection();
tmpConn.ConnectionString = @"Data Source=(LocalDB)\FFw1a;AttachDbFilename='D:\y\2\TestDB_Data.mdf'; Integrated Security=True;Connect Timeout=30;Encrypt=False";
sqlCreateDBQuery = "CREATE DATABASE TestDB ON PRIMARY "+
@"(NAME = TestDB_Data, FILENAME = 'D:\y\2\TestDB_Data.mdf', SIZE = 2MB, FILEGROWTH = 10%) "+
@"LOG ON (NAME = TestDB_Log, FILENAME = 'D:\y\2\TestDB_Log.ldf', SIZE = 1MB, FILEGROWTH = 10%)";
SqlCommand myCommand = new SqlCommand(sqlCreateDBQuery, tmpConn);
try
{
tmpConn.Open();
myCommand.ExecuteNonQuery();
MessageBox.Show("Database has been created successfully!", "Create Database", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (System.Exception ex)
{
MessageBox.Show(ex.ToString(), "Create Database", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
finally
{
tmpConn.Close();
}
return;
}
But it cause exception on 'tmpConn.Open()', and the message is:
An attempt to attach an auto-named database for file D:\y\2\TestDB_Data.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
How can I change the connection string and sqlCreateDBQuery to create a database file successfully?
|
|
|
|
|
Change the file names in the CREATE DATABASE statement so they use different file names to the one in your original connection string. You use AttachDbFilename='D:\y\2\TestDB_Data.mdf' in the connection string, then try to create a database file of the same name.
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
Tried, but also failed.
The exception is caused on 'tmpConn.Open()', not create databse anymore.
|
|
|
|
|
tmpConn.ConnectionString = @"Data Source=(LocalDB)\FFw1a;AttachDbFilename='D:\y\2\TestDB_Data.mdf'; Integrated Security=True;Connect Timeout=30;Encrypt=False";
remove this
|
|
|
|
|
I have no idea how to do that.
|
|
|
|
|
Which database engine?
Are the databases on the same server?
|
|
|
|
|
Hi All,
We have like 150 SQL Server Packages with around 20 jobs that run everyday in our Organization, for some reason some jobs are not running. What I need to do find out which Jobs ran successfully, which Jobs failed , which Jobs haven't started at all, if Job is failed then find out which steps are failed and inform to the corresponding persons with Email, for Email I wrote an Application, but I am trying to find out the ways to check the status of the Jobs, any suggestion, code snippet or even link helps me a lot.
Its little urgent, please help me - thanks in advance.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
|
I can't tell if mysql clustering could be a solution(I am thinking about galera or xtradb clustering). But my biggest problem is about the unstable internet connection.
Actually it is planned as multi-tenant setup with a single online mysql server and the tenant is separated by schema, and a tenant can also have their own local database on their location.
But I want to solve this problem first.
For example I have a tenant, but this tenant has a multiple collocation, and want to sync the data on every location and also on the online server.
They can read/write on the first, second, etc collocation server using a desktop app(respective to their location) and they can also read/write on the online server using a mobile app.
Now my problem is how could I sync them, when internet is available? So data written and updated on the first location will propagate to other server, on the online server on the second server and so on, and vice-versa.
P.S. Data deletion will be soft-delete.
Thanks.
|
|
|
|
|
|
Thanks. A very nice concept, I definitely want to try that.
|
|
|
|
|
Well I had a simple table that contained 2 contact records, in which I was able to do a join and get the 2 contacts to send emails to.
Th entire program was based in this everywhere
Then the customer wanted to be able to do 3, 4 and 5 contacts to send emails to, So I said OK to make it unlimited.
I created a new table with 1 contact record.
So now I have an invoice that is a single record, and a list of contacts that can be multiple.
I forgot about the double record if my join has 2 contacts, so that's out the window.
I have no clue what would be the best solution, perhaps start again on the design; maybe someone can point me in the right direction here.
My last resort may be loading all the contacts in a 2nd query, and using linq to match and populate.
<pre>queryString += _
" UNION ALL " & _
" SELECT " & _
" h.FINVNO " & _
", h.FCUSTNO " & _
", h.FCOMPANY " & _
", h.FSALESPN " & _
", h.FSHIPVIA " & _
", h.FORDDATE " & _
", h.FSHIPDATE " & _
", h.FNTAXAMT " & _
", (SELECT a.FADDR1 FROM ARCUS01.dbf a WHERE h.FCUSTNO = a.FCUSTNO) AS FADDR1 " & _
", (SELECT j.FPRINT FROM ARCEMJN.dbf j WHERE h.FINVNO = j.FINVNO) AS FPRINT " & _
", (SELECT j.FSENT FROM ARCEMJN.dbf j WHERE h.FINVNO = j.FINVNO) AS FSENT " & _
", (SELECT p.FBATCH FROM ARPRINT.dbf p WHERE h.FINVNO = p.FINVNO) AS FBATCH " & _
", (SELECT ce.FID, ce.FCUSTNO, ce.FCHECK, ce.FNAME, ce.FEMAIL FROM ARCEM02.dbf ce WHERE FCUSTNO = h.FCUSTNO) AS CONTACTS " & _
" FROM ARINV01H.dbf h " & _
" WHERE h.FSHIPDATE = @startDate "
Here, I started using List to return the records, so I can do further processing
I made a model with the contacts as a list. I'm in uncharted waters here, and I'm not sure if I do get the SQl to work, that I can populate the contacts using this method.
pResults.Add(New model_invoice_index() With {
.FINVNO = If(reader.IsDBNull(0), String.Empty, reader.GetString(0)),
.FCUSTNO = If(reader.IsDBNull(1), String.Empty, reader.GetString(1)),
.FCOMPANY = If(reader.IsDBNull(2), String.Empty, reader.GetString(2)),
.FSALESPN = If(reader.IsDBNull(3), String.Empty, reader.GetString(3)),
.FSHIPVIA = If(reader.IsDBNull(4), String.Empty, reader.GetString(4)),
.FORDDATE = If(reader.IsDBNull(5), New DateTime(89, 1, 1), reader.GetValue(5)),
.FSHIPDATE = If(reader.IsDBNull(6), New DateTime(89, 1, 1), reader.GetValue(6)),
.FNTAXAMT = If(reader.IsDBNull(7), 0.0, reader.GetValue(7)),
.FADDR1 = If(reader.IsDBNull(8), String.Empty, reader.GetString(8)),
.FPRINT = If(reader.IsDBNull(9), False, reader.GetValue(9)),
.FSENT = If(reader.IsDBNull(10), False, reader.GetValue(10)),
.FBATCH = If(reader.IsDBNull(11), False, reader.GetValue(11)),
.FCONTACTS = New List(Of model_invoice_contacts()) With {
dsdaasd
}
}
If it ain't broke don't fix it
|
|
|
|
|
I've created a flash animation clip, Username & password also set that file. now i want to integrate this File with my another java application,with giving this files to link & never ask flash file password, because I've only one UI for java application only
now the how to get a key from javadb to flash?
|
|
|
|
|
Isn't flash, like Silverlight, no longer supported in current browsers which should mean you are wasting your effort coding flash animations.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: no longer supported in current browsers
It's not dead yet, but it's not looking too healthy.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
how to retrive data from database in android
|
|
|
|
|
|
Hello,
I'm trying to call the following MySQL SP:
DROP PROCEDURE IF EXISTS tgc.UpdateCustomerBalance;
CREATE PROCEDURE tgc.`UpdateCustomerBalance`(customerId varchar(50), cost Decimal(8,2))
BEGIN
UPDATE Customers SET Balance = Balance - cost WHERE CustomerId = customerId;
END;
with the following C# code:
try
{
using (var context = new Db_Entities())
{
object[] parameters =
{
new MySql.Data.MySqlClient.MySqlParameter("@customerId", customerId),
new MySql.Data.MySqlClient.MySqlParameter("@cost", cost)
};
await context.Database.ExecuteSqlCommandAsync("UpdateCustomerBalance @customerId,@cost", parameters);
}
}
catch (Exception e)
{
throw;
}
But I receive the error:
"Message": "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UpdateCustomerBalance 'xyz',0.03' at line 1",
Can anyone help shed some light on this? I've tried all sort and am now seeing tunnel vision.
Incidentally, this works:
await context.Database.ExecuteSqlCommandAsync("UPDATE Customers SET Balance = Balance - " + cost + " WHERE CustomerId = '" + customerId + "'");
All help appreciated.
|
|
|
|
|