|
Thanks for your reply, I appreciate it.
Regards, Werries
A programmer's life is good... or is it?? Ek dink nie so nie!
|
|
|
|
|
hello
i have written a program which connects to an internet database(mysql) using odbc. the program works fine on a system which is directly connected to the internet but fails to connect to the database on other systems in the lan.
Thank you
|
|
|
|
|
One option I can think of would be to place the system with the database in the DMZ host area on the LAN.
David
|
|
|
|
|
Hi There,
Im having problems making a simple datagridview update.
The datagridview is bound to a dataset.
The three posted examples are in C# and are made in VS 2005 Express.
Im not recieving any errors and i can see the changed records being passed in all three examples when debugging.
Everything looks fine, except that the database is not updated?
Furthermore, i have made sure that the update commands ok.
Which means that the commands are present and does not contain joins.
Refresh table has also been cheched on in the table adapter configuration.
This is supposed to be dead easy..b1"#ch wine moan ...
Here is my examples:
Could someone please give me a clue to what im doing wrong?
Thanks.
//Update method1
//
private void btnSave_Click(object sender, EventArgs e)
{
myDataGridView.BindingContext[myDataSet.myDataTable].EndCurrentEdit();
DataSetType.DataTableType myChangedRows = (DataSetType.DataTableType)myDataSet.myDataTable.GetChanges();
if (myChangedRows != null)
{
myTableAdapter.Update(myChangedRows); //myChangedRows as DataSetType.DataTableType
myDataSet.myDataTable.AcceptChanges();
}
}
//Update method2
//
private void btnSave_Click(object sender, EventArgs e)
{
myDataGridView.BindingContext[myDataSet.myDataTable].EndCurrentEdit();
if (myChangedRows != null)
{
for (int i = 0; i < myChangedRows.Rows.Count; i++)
{
//Using custom SQL-Comand UpdateRow
myTableAdapter.UpdateRow((int)myChangedRows.Rows[i].ItemArray.GetValue(0), ((Guid)myChangedRows.Rows[i].ItemArray.GetValue(4)));
}
myDataSet.myDataTable.AcceptChanges();
}
}
//Update metohod3
//
private void btnSave_Click(object sender, EventArgs e)
{
myDataGridView.BindingContext[myDataSet.myDataTable].EndCurrentEdit();
if (myDataSet.HasChanges())
{
DataRow[] myChangedRows = (DataSetType.DataTableType)myDataSet.myDataTable.GetChanges();
myTableAdapter.Update(myChangedRows); //myChangedRows as array of DataRow
myDataSet.myDataTable.AcceptChanges();
}
}
-- modified at 14:37 Friday 18th May, 2007
|
|
|
|
|
After having creating several other test projects in an attempt to update my database, i realized that the sql database file (.mdf) is copyed to the output directory everytime the program is being debugged. Very nice...
When setting the copy option to "copy if never" im able to update the database.
I dont understand why this "copy if never" option is not set by default?
Can anybody explain why i can only select filebased databases when creating new data sources?
Is this a vs2005 Express limitation?
Adding a connection string manually to the app.config works however.
Cheers
|
|
|
|
|
Hi
I trying to populate GridView with a DataSource and I am getting a Null Reference Exception at "dsource.ConnectionString"
My method is something like this.....
SqlDataSource dsource = null;
if (!Page.IsPostBack)
{
dsource = new SqlDataSource();
dsource.ConnectionString = ConfigurationManager.ConnectionStrings ["Provider=SQLOLEDB.1;User ID=sa;Password=sa;Initial Catalog=ESS;Data Source=ESS134"].ConnectionString;
dsource.DataSourceMode = SqlDataSourceMode.DataReader;
dsource.ProviderName = "System.Data.OleDb";
dsource.SelectCommand = "SELECT * FROM StateUSA";
gvState.DataSource = dsource;
gvState.DataBind();
}
Please assist me in this regard.
Thank U
Chandu
|
|
|
|
|
If you step through the above code with the debugger, you will find one of the objects is null. I am guessing that it is the connection string. Normally when you access the connection string. If it exists in your config file under connectionStrings you just need to enter the name of the key so your code would be ConfigurationManager.ConnectionStrings["keynamehere"];
You are actually giving the full connectionstring name. So your code should be:
dsource.ConnectionString = "Provider=SQLOLEDB.1;User ID=saassword=sa;Initial Catalog=ESS;Data Source=ESS134";
By the way it is a really bad idea to have the sa password be sa.
Hope that helps.
Ben
|
|
|
|
|
The Following Procedure is Supposed to create a new Record in the Table, but what it does it alter the First record in the table and change the values i have supplied in the current record. am taking those values from VB6 form.
Create Procedure prcInserting @Num_key varchar(10),@Extension int,@Cell_ID int,
@Actual_Extent float,@Lis_key varchar(50), @Func_key varchar(8)
with recompile
as
insert into Property(Num_key,Extension,Cell_ID,Actual_Extent,Lis_key,Func_key,Active,Add_date,Add_User_ID,Spatial_ADD_Date,Rateable,Non_Discreet_Valid)
values (@Num_key,@Extension,@Cell_ID,@Actual_Extent,@Lis_key, @Func_key,0,getdate(),1,getdate(),0,0)
Please Help
Vuyiswa
|
|
|
|
|
This will create the record in the database as an insert does not do an update of a record (unless you have done something insane like use a trigger to perform an update). Have you actually looked inside the table to see if the record is added or not? Don't rely on the order of the table that is returned by a plain SELECT... to ascertain whether or not the record has been added.
If I were you, I would do a count on the rows already present. Then run the procedure, and finally do a count again. If the row count is different then it's successfully inserted.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hERE ARE THE COUNTS
/*First Count*/
537893
/*Second Count*/
537895
As you can see the Count is increased by two. what can be a Problem Because i dont have anty update trigger in the table
Vuyiswa
|
|
|
|
|
Well - it's obviously inserting. It sounds like you may have fired the SP twice here.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
i used Vb6 front end to fire the Proc, when save button is click the it become disabled and the recordset move to the First record, so there is no way to be fired twice.
what do you think is Wrong? Do you want me to send you the vb6 code?
Vuyiswa
|
|
|
|
|
Vuyiswamb wrote: what do you think is Wrong? Do you want me to send you the vb6 code?
No.
If I were you, I would take a look at using the SQL Profiler to see what is actually coming across. For an example of how to do this, read this article Clickety[^]
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
AM NOT SURE, I THINK THE pROBLEM IS IN MY BUTTON, THIS IS THE CODE IN MY BUTTON TO SAVE .
Private Sub cmdAdd_Click()
rrs("Num_key") = txtnumkey
rrs("EXTENSION") = txtextension
rrs("Actual_Extent") = txtactualextent
rrs("Lis_key") = txtliskey
rrs("Func_Key") = txtfunckey
rrs("Prop_Category_ID") = txtcategory
rrs("GEOCODE") = txtgeocode
rrs("Add_Date") = txtadddate
rrs("Add_user_ID") = txtadduserid
rrs.Update
cmdNew.Visible = True
cmdUpdate.Visible = True
cmdRefresh.Visible = True
cmdDelete.Visible = True
End Sub
IS IT CORRECT?
Vuyiswa
Vuyiswa
|
|
|
|
|
Hi
I have SQL server installed in a machine. From another machine if I create a DSN using windows authentication, I am getting an erro message.
Thanks
|
|
|
|
|
Windows Authentication means that the user account that the client application is running under is the account used to connect to SQL Server. That means that either the server and client must be in the same Windows domain or forest or that the server and client domains/forests must trust each other, or that there must be a Windows user account on the server with the same username and password as the client software runs as.
In addition, the user, or a group that the user is a member of, must be granted a login on the instance of SQL Server that you're connecting to, and that login must be mapped to a user or role in the database you're trying to use.
|
|
|
|
|
Hi All,
what is the use of import or export feature in SQL Server2000
and also wht is the difference between import/export and backup/store database
|
|
|
|
|
These options are provided for the movement of databases!!!
Let us say you have Database A and now you created Database B and in this you want the same data aso Database A then you can use these options.
Other example would be, If you want get to data for DataBase B from any other source like Access then again you have to use these options.
Gautham
|
|
|
|
|
Hi All
I am doing an analysis on a web project whre the estimated number of concurent users is between 2000 & 3000.
In this project iam doing tracing and need to put this trace in SQL table. my question is how many rows can this table hold knowing that number of records per year is between 2 & 3 millions. This table will take time when trying to query data in it.
What strategies must be taken?
Thanks
|
|
|
|
|
You can easily insert this number of records into a SQL Server table. If you want to query the data in the table, you may want to copy it into a different database and add additional indexes to speed up the querying (or you could look at using an Indexed view on it).
If this is a really active table that only uses inserts, then don't put any indexes on it other than a primary key. Use the suggestions above for reporting purposes.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi there,
If I use SQL Server Migration Assistant for Access to convert my Access database to SQL Server Database, it adds constraints to each string type data column in my SQL database. Why is that? I've checked the string values in my Access database, and they do allow Zero Lenth values. If I add that Access database to my SQL Server Migration Assistant for Access project, and I select a Table to see the design of it, the Allow Zero Lenth flag is false. I want those characterlistics to be the same as in the Access Database. Is there a way to do that?
Thanks,
Werries
A programmer's life is good... or is it?? Ek dink nie so nie!
|
|
|
|
|
I have written a SQL procedure to send mail using CDONTS. Now I want to specify Smart Host name in the procedure itself instead of specifying it in the IIS(Default SMTP Server). How I can do that.
thanks in advance
|
|
|
|
|
hello frnds,
I have a problem
i have 3 tables updating one by another if any of the update query get failed the whole transaction should be rollback and if the update query get successful then the transaction should be get commit,
i have called three methods for three table and if exception occour then in last method transaction object as rollback but failed...
plzz help me....
thankx in advance
-Koolprasad2006
Be A Good S/W Eng... Life is swing with you..Enjoy..
|
|
|
|
|
begin transaction
update statement1.......
if(@@error<>0)
begin
rollback transaction
end
update statement2.......
if(@@error<>0)
begin
rollback transaction
end
update transaction3......
if(@@error<>0)
begin
rollback transaction
end
commit transaction
end
Try this out, hope this works if not will look for other options.
Gautham
|
|
|
|
|
Hi All,
I have one connection string which can be of MySql, Sql Server , Orable , access or anything.
i have create OdbcConnection object from connection string. now i want to know which DBMS i am using... any idea how to ?
- thanks & ragards
- Sanket
|
|
|
|