|
Hi,
I have a project with MySQL server database. unfortunately, MySQL doesn't provide a feature to password protect my database (unlike Microsoft SQL Server).
So what's your advise?
Shall I install my application on a separate MySQL instance so I will only have the password?
Technology News @ www.JassimRahma.com
|
|
|
|
|
|
but this will protect the server!
What I want is to give my database a password so their administrator who'll access the same server won't be able to access my entire database even if he has a root for the same server because my database is password protected.
This option is available in Microsoft SQL Server and it's working great
Technology News @ www.JassimRahma.com
|
|
|
|
|
Jassim Rahma wrote: This option is available in Microsoft SQL Server and it's working great
Are you sure about that? Any administrator of the domain / local machine can easily give themselves unrestricted access[^] to a SQL instance, even if they're not set up as a user in SQL.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Jassim Rahma wrote: So what's your advise? Webservices, and hosting the server yourself. Easy argumentation; you'll only be the database-admin if the server is yours.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Update: This did turn out to be a pretty simple issue, so I am marking it now as an Answer. See the end of the message for the Answer...
I suspect I am making a very simple error, because I have a Windows Form application where I have added an Entity Framework DataSource bound to controls via a BindingSource/BindingNavigator that is not saving changes to the underlying SQL database.
I started by dragging the Entity Framework DataSource (as Details) onto a form.
This automatically created the form controls, the BindingSource and BindingNavigator.
When I first brought up the form, no records where being returned from the Entity Framework DataSource, so I created the following variable to initially load data that I was then able to view:
Private TblList As ObjectQuery(Of tblMyTableRec) = From tbl In ObjCntxt.tblMyTableRecs
Then I set the DataSource property of the appropriate BindingSource to this ObjectQuery:
MyBindingSource.DataSource = TblList
So far, so good ... The BindingNavigator now lets me move through the various records in the 'tblMyTableRecs' table.
But, when I make a modification of the data in any of the records (via one of the data bound controls), my changes are not being saved to the underlying SQL database the Entity Framework is setup to use.
I would greatly appreciate any suggestions about what steps I might need to take so that I am able to have changes saved in my SQL database.
Answer: The code generated for the Windows Form BindingSource and BindingNavigator do not automatically perform the Entity Framework ObjectContext SaveChanges operation. Once the SaveChanges function was executed in the Save button Event logic for the appropriate Entity Framework ObjectContext, the changes were saved to the SQL database.
Thanks, Dean
modified 5-Dec-13 21:18pm.
|
|
|
|
|
Hi friends. Can you tell me a perfect and simple website or book to know about the basic concept of OOPS in VB.net. Dont suggest simply google it. Specify some link or e-book.
|
|
|
|
|
You do know you posted in the Database forum?
|
|
|
|
|
I do know.But I believed that there will be someone to help me.
|
|
|
|
|
You don't think you would be more likely to receive relevant advice from the VB forum?
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
|
|
hi,
am selecting data from table . and executed reader with rdr=cmd.executereader()
based on the result i need to write the logic.
if( returns null)
{
}
else
{
}
|
|
|
|
|
|
eventhough it's not working properly.
here is the code
string query1 = "SELECT tag_id,category_id,product_id,product_name,gate_id,remarks FROM transaction where tag_id Like '" + sEPC + "' AND out_time=NULL";
MySqlCommand cmd1 = new MySqlCommand(query1, connection);
MySqlDataReader rdr1 = cmd1.ExecuteReader();
if (rdr1.HasRows==true)
{
item.SubItems[OUTTime.Index].Text = s2;
rdr1.Close();
String s1 = "update transaction set out_time='" + s2 + "' where tag_id='" + sEPC + "' ";
MySqlCommand cmd2 = new MySqlCommand(s1, connection);
cmd2.ExecuteNonQuery();
}
else
{
rdr1.Close();
item.SubItems[INTime.Index].Text = s2;
String a0 = ListView1_EPC.Items[0].Text;
String a1 = item.SubItems[1].Text;
String a2 = item.SubItems[2].Text;
String a3 = item.SubItems[3].Text;
String a4 = item.SubItems[4].Text;
String a5 = item.SubItems[5].Text;
String str = "insert into transaction(tag_id,category_id,product_id,product_name,gate_id,in_time,remarks)values('" + a0+ "','" + a1 + "','" + a2 + "','" + a3 + "','" + a4 + "','" +s2 + "' ,'"+a5+"')";
MySqlCommand cmd2 = new MySqlCommand(str, connection);
cmd2.ExecuteNonQuery();
}
|
|
|
|
|
Define not working properly?
also to read from the reader you have to do this
if(rdr1.HasRows == true)
{
while (rdr1.Read())
{
int id = Convert.ToInt(rdr1["ID"]);
}
}
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
no i don't want to read the data of reader. datatype of out_time and in_time in mysql table is datetime.
my problem is:
1.select the data from transaction where tagid=? and outtime=null
2. if reader is having rows then write outtime into transaction table.
else
insert row into transaction table with only intime, no outtime
here is the code :
string query1 = "SELECT tag_id,category_id,product_id,product_name,gate_id,remarks FROM transaction where tag_id Like '" + sEPC + "' AND out_time=NULL";
MySqlCommand cmd1 = new MySqlCommand(query1, connection);
MySqlDataReader rdr1 = cmd1.ExecuteReader();
if (rdr1.HasRows==true)
{
item.SubItems[OUTTime.Index].Text = s2;
rdr1.Close();
String s1 = "update transaction set out_time='" + s2 + "' where tag_id='" + sEPC + "' ";
MySqlCommand cmd2 = new MySqlCommand(s1, connection);
cmd2.ExecuteNonQuery();
}
else
{
rdr1.Close();
item.SubItems[INTime.Index].Text = s2;
String a0 = ListView1_EPC.Items[0].Text;
String a1 = item.SubItems[1].Text;
String a2 = item.SubItems[2].Text;
String a3 = item.SubItems[3].Text;
String a4 = item.SubItems[4].Text;
String a5 = item.SubItems[5].Text;
String str = "insert into transaction(tag_id,category_id,product_id,product_name,gate_id,in_time,remarks)values('" + a0+ "','" + a1 + "','" + a2 + "','" + a3 + "','" + a4 + "','" +s2 + "' ,'"+a5+"')";
MySqlCommand cmd2 = new MySqlCommand(str, connection);
cmd2.ExecuteNonQuery();
}
}
here contains current date. everytime (even select command returns data ) it is executing else block only.is there any mistake in select query.
|
|
|
|
|
ok i got it. thanks for the help..
But now the problem is , i can have multiple records with same tag_id,
when i update all the records with same tag_id is updating.
i need to update only the latest record. how can i solve this.......
|
|
|
|
|
Can SUM() Function be used inside cursors??
I used it but the code goes on executing. more than 10 minutes.
Why??
modified 28-Nov-13 2:03am.
|
|
|
|
|
tsunamigang wrote: Can SUM() Function be used inside cursors?? Yes.
tsunamigang wrote: I used it but the code goes on executing. more than 10 minutes.
Why?? Show us yer code, then we may be able to help.
It sounds to me like you have not set up the condition on the cursor loop allowing the cursor to exit or you are not reading the next record from the cursor hence potentially leading to an endless loop.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
modified 28-Nov-13 5:40am.
|
|
|
|
|
Exactly. I have not fetched next row at the bottom. Thanks for your reply.
|
|
|
|
|
Cool
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
Friends,
I have a few questions. The company I work for is using SQL server 2008 R2 with the Point Of Sale software for the retail operations. The company has 15 locations and we are growing fast. I am not new to SQL, but I have not had the opportunity to work with it like I do at this job. The main focus is reporting.
Here are my questions:
1) How do you get the information from a DB you will need to start to build queries, when you want to build a query from a proprietary database?
2) I am working on reporting through a GUI interface. My goal is to have the knowledge to build CUSTOM reports via queries. With CRE we have the option for RAW SQL Queries. What is the best way for a beginner to educate himself on SQL Server 2008 R2 SSRS (e.g. Books, Lab, etc.)?
3) On the same line as question 2, we would like to build a portal to interface with the 15 retail locations to the corporate office in order to obtain "Real Time" reporting. What is the best reference material for this project?
Thanks for your time!
Any help, will be greatly appreciated!
Mr. Khris Kaylor
|
|
|
|
|
This is not a set of questions you should rely on a forum to answer. You are going to need a professional in the area of setting up a distributed database environment with replication back to HO and probably setting up an OLAP reporting structure. It can be VERY expensive to get this wrong.
SSRS is excellent for canned reports but not the right tool for dynamic queries, for that you need to look at Business Intelligence (BI) solutions and visualisation tools.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
<pre lang="sql">SELECT *
INTO OPENDATASOURCE('SQLNCLI',
'Data Source=.\sqlexpress;User ID=sa;Password=sa')
.[fuzzyTest].dbo.tblGroup
FROM [CMS].[Common].[File];</pre>
This is not working and giving error !
I dont wanna to use
<pre lang="sql">INSERT INTO [CMS].[Common].[File]
(Name,IdParent,[Desc])
SELECT [Name],[IdOstan]+30,''
FROM OPENDATASOURCE(
'SQLOLEDB',
'Data Source=.\sqlexpress;User ID=sa;Password=sa'
).[fuzzyTest].dbo.tblGroup</pre>
modified 27-Nov-13 1:02am.
|
|
|
|