|
yamunarani wrote: explain in detail.
The new snd codz plz
Sorry if you cannot work it out then I can't help you.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi All
How can i install and configure mssql database server for netwoek?I have a network and all machine is member of domain.How can i make connection through client with server?In the client side i have Xp OS and Server Side XP server 2003.
Plz help me
|
|
|
|
|
Open Surface Area configuration for your server and enable remote connections then clients will be able to connect to it through a valid username and password.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Thanks for reply.I am try to do.
|
|
|
|
|
Sorry to say there is no effect.Still i am hunting how to connect.
Can you provide me how o install MsSQL server on Server machine then configure on client machine document.
Plz help me.
|
|
|
|
|
Persumably you have access to the media for SQL Srver (it does not automatically come with Windows Server 2003, but is a separate product). If so the installation istructions for SQL Server 2008 can be found here[^]. There are similar instructions for each version of SQL Server since SQL 7.0 elsewhere on the same web server. Just navigate to the "SQL Server" node and select the appropriate version.
It is not likely that anyone will be willing to duplicate all of those instructions in a reply to your post, so your best bet is to use the provided link.
|
|
|
|
|
i am inserting two record in data base usin txtReg and txtname using acess database when i run my program it shows following error
Execute Nonquery : Connection properly has not been initialized
here is my code
need help
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;
using System.Data.OleDb ;
namespace studentManagementSystem1
{
public partial class StudentDetails : Form
{
public OleDbCommand cmd;
public OleDbConnection con;
string connectionString, query;
public StudentDetails()
{
InitializeComponent();
}
private void StudentDetails_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'studmanageDataSet.master' table. You can move, or remove it, as needed.
this.masterTableAdapter.Fill(this.studmanageDataSet.master);
connectionString =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\studentManagementSystem1\studmanage.mdb";
}
private void btnAdd_Click(object sender, EventArgs e)
{
int rows;
query = "INSERT INTO master(RegNo,Name)VALUES(@RegNo,@Name)";
cmd = new OleDbCommand(query, con);
con = new OleDbConnection(this.connectionString);
cmd.Parameters.AddWithValue("@RegNo", txtRegNo.Text );
cmd.Parameters.AddWithValue("@Name", txtName.Text );
try
{
con = new OleDbConnection(this.connectionString);
con.Open();
rows = cmd.ExecuteNonQuery();
if (rows > 0)
{
MessageBox.Show("records inserted successfully");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
con.Close();
}
}
private void btnEdit_Click(object sender, EventArgs e)
{
}
}
}
|
|
|
|
|
I would say just change the order of these two lines from:
cmd = new OleDbCommand(query, con);
con = new OleDbConnection(this.connectionString);
to:
con = new OleDbConnection(this.connectionString);
cmd = new OleDbCommand(query, con);
because you initializing your OleDbCommand (cmd) with a not initilized connection value.
Edit:
I reviewed your code and saw some other things you do wrong.
Your function btnAdd_Click should look like:
private void btnAdd_Click(object sender, EventArgs e)
{
int rows;
query = "INSERT INTO master(RegNo,Name)VALUES(@RegNo,@Name)";
con = null;
try
{
con = new OleDbConnection(this.connectionString);
con.Open();
cmd = new OleDbCommand(query, con);
cmd.Parameters.AddWithValue("@RegNo", txtRegNo.Text );
cmd.Parameters.AddWithValue("@Name", txtName.Text );
rows = cmd.ExecuteNonQuery();
if (rows > 0)
MessageBox.Show("records inserted successfully");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
if(con != null)
con.Close();
}
}
Greetings
Covean
PS: Its a not the best way to do queries in the ui-code.
|
|
|
|
|
Two points:
1. This is a database forum not a c# one which is where your question should go as it's an ADO.Net issue.
2. If you have already started a thread, don't start a new one on exactly the same issue 12 hours later.
Have you even tried using Google to find an answer by searching on the error message?
|
|
|
|
|
1) You have already asked this question in another thread on this forum
2) You have been advised this is not the correct forum for your question
3) It's clear you don't understand what you are doing. Go read a book, then come back and ask any questions in the appropriate forum.
only two letters away from being an asset
|
|
|
|
|
Good Day All
I have a Package created and hosted in a Machine(Theresa) that has SQL 2008 and i have my Development Machine(Vuyiswa) that has IIS and am Debugging from the my machine. i have a ASP.NET 2.0 App and am executing a Package that in another machine. The First thing i did was to share a directory where the Packages are stored when i install the packages and supplied "Everyone","ASP.NET","Vuyiswa" Accounts permissions to to access this share. i can go into the share from the another machine without any problem. i have a code like this in my ASP.NET App
try
{
Application app = new Application();
Package package = null;
package = app.LoadPackage(@"D:\Program Files\Microsoft SQL Server\100\DTS\Packages\OMEGA\OMEGA.dtsx", null);
Variables vars = package.Variables;
vars["Time1"].Value = time;
vars["Time2"].Value = time;
vars["Time3"].Value = time;
vars["TTBLTYPE"].Value = THREAD_DATA[1].ToString();
Microsoft.SqlServer.Dts.Runtime.DTSExecResult results = package.Execute();
if (results == Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure)
{
foreach (Microsoft.SqlServer.Dts.Runtime.DtsError local_DtsError in package.Errors)
{
Console.WriteLine("Package Execution results: {0}", local_DtsError.Description.ToString());
Console.WriteLine();
}
}
}
catch (DtsException ex)
{
Exception = ex.Message;
}
This execute Fine until the
Microsoft.SqlServer.Dts.Runtime.DTSExecResult results = package.Execute();
it does not stop here , but i trap it here
if (results == Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure)
and the Error am Getting is
"SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E4D.\r\nAn OLE DB record is available. Source:\"Microsoft SQL Server Native Client 10.0" Hresult: 0x80040E4D Description: "Login failed for user 'sa'
On my Package i use the "sa" credentials and my Protection Level is "Dont Save Sensative"
Thank you
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Does your sql server support sql authentication? It is usually not enabled by default, but must be turned on.
|
|
|
|
|
yes it does. i have resolved this Problem by adding a dts config file. The Problem was that the Connection Manager was not saving the Password. so i had to make sure that is there by Explicitly adding it in the config File.
Thank you for your Reply
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hi all,
I used VS2005 with EnumAvailableSqlServers to list all the SQL Server, but when I upgrade to VS Team 2008, EnumAvailableSqlServers does not list SQL 2000 Server in the list.
Imports Microsoft.SqlServer.Management.Smo.SmoApplication
Dim dtServer As DataTable = EnumAvailableSqlServers(False)
Please help me!
Thanks a lot.
|
|
|
|
|
Have you upgraded Sql Server as well ?
SMO is changed in Sql Server 2008
|
|
|
|
|
Not yet, I use SQL Server 2005 Express and SQL Server 2000. Do I have to upgrade my SQL Server to 2008?
|
|
|
|
|
No... Have you taken the proper reference to SMO dll.. Actually if you have, it should be working.
The dlls will only change if you change the Version of Management objects. Check if the reference is kept intact after installing VS 2008.
|
|
|
|
|
My VS Team 2008 DVD only have SQL 2005 Express. Thus, I have to buy SQL 2008 or only need SQL 2008 Express?
Thanks.
|
|
|
|
|
hi everybody! I am working for a project named "Video Monitor". It required "record video by plan".
My logic designed as follow:
1.date type data.
------------------------
date date type
--------- ------------
monday working day
. .
. .
. .
friday working day
saturday rest day
sunday rest day
1.1 New Year's Day
2009.10.30 special day 1
2010.2.3 special day 2
. .
. .
. .
--------------------------
2.day record plan
-------------------------------------------------------------------
day time action cameraNum
---- ------- --------- ------------
working day 06.00 begin record by timed 1,2
working day 18.00 end record by timed 1,2
rest day 06.00 begin record by move detect 3,4
New Year's day 06.00 begin record by move detect 1,2,3,4
special day 1 09.00 begin record by timed 2
special day 1 12.00 end record by timed 2
. . . .
. . . .
. . . .
---------------------------------------------------------------------
How to designed database and tables? column's type?...
somebody tell me to save such datas in txt file or XML file. but i think save
to database is best. am i think right?
|
|
|
|
|
We use a combination of a user defined function UDF and a table called holidays, this allows us to generate a record set of #n dates and if the date is in the holiday table it is flagged. We use a combination of dayinweek and the holiday table to define processing dates. I am stuck with a Chinese New Year that does not have a fixed date.
|
|
|
|
|
Can you explain in detail, thank you!
|
|
|
|
|
Do you know what a UDF is and how they function?
Create a UDF that returns a rowset with dates and their state for defined period eg 200 days from 1/10/2009
In the UDF you create a table variable that you populate using the DataAdd function in a while loop
You then update the state based of DayOfWeek function
You then do a join to the holiday table to update the state based on dates entered by the user into the holiday table
(All of the above can be achieved in 1 step but try it in 3 steps to get a feel for the processes)
Return the rowset to the stored proc that called it where it can be used in a join or select statement.
|
|
|
|
|
i know UDF is user defined function. but i want to know is the column's type,
for example, monday and 2010.1.0 column's data type,is date? or enum? or others?
|
|
|
|
|
iceman8616 wrote: 2010.1.0 column's data type
This is not a date!
iceman8616 wrote: or enum
I do not know of an enum column data type in SQL Server
I would have a 2 column table Date datetime and State int or varchar
|
|
|
|
|
I am inserting two records from txtxbox name as txtRegno and txtName
when i run my prog i got error at con.open(); as object reference not set to an instsnce of an object
need help
here is the code
using System;<br />
using System.Collections.Generic;<br />
using System.ComponentModel;<br />
using System.Data;<br />
using System.Drawing;<br />
using System.Linq;<br />
using System.Text;<br />
using System.Windows.Forms;<br />
using System.Data.OleDb ;<br />
<br />
namespace studentManagementSystem1<br />
{<br />
public partial class StudentDetails : Form<br />
{<br />
public OleDbCommand cmd;<br />
public OleDbConnection con;<br />
<br />
string connectionString, query;<br />
public StudentDetails()<br />
{<br />
InitializeComponent();<br />
}<br />
<br />
<br />
<br />
private void StudentDetails_Load(object sender, EventArgs e)<br />
{<br />
<br />
this.masterTableAdapter.Fill(this.studmanageDataSet.master);<br />
<br />
connectionString =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\studentManagementSystem1\studmanage.mdb";<br />
<br />
}<br />
<br />
private void btnAdd_Click(object sender, EventArgs e)<br />
{<br />
<br />
<br />
int rows;<br />
<br />
<br />
query = "INSERT INTO master(RegNo,Name)VALUES(@RegNo,@Name)";<br />
<br />
cmd = new OleDbCommand(query, con);<br />
<br />
cmd.Parameters.AddWithValue("@RegNo", txtRegNo.Text );<br />
cmd.Parameters.AddWithValue("@Name", txtName.Text );<br />
<br />
<br />
<br />
try<br />
{<br />
<big>con.Open(); </big> <br />
rows = cmd.ExecuteNonQuery();<br />
if (rows > 0)<br />
{<br />
MessageBox.Show("records inserted successfully");<br />
}<br />
}<br />
catch (Exception ex)<br />
{<br />
MessageBox.Show(ex.Message);<br />
}<br />
finally<br />
{<br />
con.Close();<br />
}<br />
}<br />
<br />
private void btnEdit_Click(object sender, EventArgs e)<br />
{<br />
<br />
}<br />
<br />
<br />
<br />
<br />
}<br />
}
|
|
|
|