|
You will have to synchronize everything manually, but you could create a scheduled subscription for every report and choose Windows File Share as a delivery method. Then, after all the reports are processed, you can get the files from the share and e-mail them.
I know it's not an answer to your question, but that's the solution that comes to my mind.
|
|
|
|
|
Thank You , Even i thought about this but it will take a lot of time since we have aroung 300 clients and we need to set different reports and subscription for each client . Most of the reports are client based so we have to give the Client no as one of the parameters And it will take a lot of time any way Thank you for ur help , If you have any solution come in ur mind please let me know
Thanks in Advance
|
|
|
|
|
Hi
I am doing an application on Super Market. I have to generate a random number for bill ID and I have to keep the same bill ID to all the records of a single customer.
I am successful in generating the Bill ID with the function
public int randomBillNo()
{
Random rndNum = new Random();
MyRandomNumber = rndNum.Next(1, 99999999);
return MyRandomNumber;
}
But every time I post back the page or click a button to generate a record for a particular Bill,this random number keeps on changing.
I have to keep that random number constant for all the items of a particular bill,so that I can get all the records with that bill ID if needed.
If I generate manually I have a chance to get the dupilcate bill IDs at the time of bill generation
So,please asist me in this regard
Thanks
Chandu
|
|
|
|
|
it would be more simpler if u have a database column as auto incremented which would never need to generate bill id while creting a record.
also for other records of the same customer u can fetch the bill id auto generated and use it.
shivaramkrishna
|
|
|
|
|
Instead of this
K V S Chand wrote: MyRandomNumber = rndNum.Next(1, 99999999);
use this:
MyRandomNumber = rndNum.Next(1, int.MaxValue);
It will give you a range of 1..2147483647
K V S Chand wrote: If I generate manually I have a chance to get the dupilcate bill IDs at the time of bill generation
How come? If you generate by random you have the chance to get duplicates(although very small under these conditions). If you generate manually you could write for example an incremental generator which will never fail.
|
|
|
|
|
as far as i understand, if every time of post back, a new random number is generated, it simply means that you are calling randomBillNo() function in page load event.
to solve this problem add a condition before calling the function (i.e.)
if(!isPostBack)
randomBillNo();
still this function can return duplicate bill IDs therefore you must also check for duplication before saving the record.
*************************
SetNewGoal:
while (GoalNotAchieved){}
goto SetNewGoal;
*************************
|
|
|
|
|
|
how to add my .exe,Msaccess database file and .netframework1.1 to setup file in .NET
|
|
|
|
|
|
I have a data table with data in it.
I want to insert data from this data table into a physical table in oracle. If both tables are in oracle then by using the sql I could insert like
insert into temp2 (select * from temp1).
temp1 and temp2 are oracle tables. but in my situation, temp1 is a datatable. How can I do this?
thanks much in advance.
If there is any sample code, please post it or post the link to it.
regards
n :(ath
|
|
|
|
|
Dim SelectCmd1 As New SqlCommand("SELECT [rawvalue] FROM [datastore] WHERE timestamp=(SELECT MAX(timestamp) FROM [datastore]) AND name='s1'", SQLconn)
SelectCmd1.CommandType = CommandType.Text
Dim result1 As Integer
Dim myDataReader1 As SqlDataReader
myDataReader1 = SelectCmd1.ExecuteReader()
myDataReader1.Read()
result1 = myDataReader1.GetInt32(0)
SQLconn.Close()
SQLconn.Open()
Dim SelectCmd2 As New SqlCommand("SELECT [rawvalue] FROM [datastore] WHERE timestamp=(SELECT MAX(timestamp) FROM [datastore]) AND name='s2'", SQLconn)
SelectCmd2.CommandType = CommandType.Text
Dim result2 As Integer
Dim myDataReader2 As SqlDataReader
myDataReader2 = SelectCmd2.ExecuteReader()
myDataReader2.Read()
result2 = myDataReader2.GetInt32(0)
SQLconn.Close()
I have a table with records:
name rawvalue quality timestamp
s1______-1_____good____12-6-2007 9:45:00
s3______-1_____bad____13-5-2007 11:50:51
s1_____0_____good____14-7-2007 8:40:54
s2_____0____good____15-5-2007 6:00:45
.
.
.
I read the most recent inserted "rawvalue" in the table to initialize 2 asp controls. I get an error for in the second query. And the error is "Invalid attempt to read when no data is present."
I get the same error then I run the query in Sql Server Management Studio.
The problem is with "timestamp". The "Max(timestamp)=14-7-2007 8:40:54"(3rd record) so it diplays he rawvalue="0" for s1.
But for s2 I don't get any values....because the timestamp = 15-5-2007 6:00:45 < 14-7-2007 8:40:54
What modification do I have to do in query to display the ravalues for both s1 and s2?
When I use this:
SELECT [rawvalue] FROM [datastore] WHERE timestamp=((SELECT MAX(timestamp) FROM [datastore]) AND name='s1')
I get incorrect syntax near AND.
-- modified at 13:12 Monday 14th May, 2007
|
|
|
|
|
Have you thought about using ExecuteScalar instead of ExecuteReader ? ExecuteScalar is used when you only want to retrieve the first column of the first row of the result set (typically when yours select only retrieves one row with one column in in)
Also, I suspect that your second query is returning zero rows. You don't check for the condition of no data being returned, hence the error. Using ExecuteScalar will remove the error and return null if no data is being returned from the query instead of throwing an error.
In order that the query returns data, I'm guessing that you want the condition of the MAX timestap AND the name. You need to specify the name twice, once inside the subquery and once outside it.
kallileo wrote: SELECT MAX(timestamp) FROM [datastore]) AND name='s1'
This is just the subquery on its own. It should be easier to spot WHERE the error is.
The full query should be:
SELECT [rawvalue]
FROM [datastore]
WHERE timestamp=((SELECT MAX(timestamp) FROM [datastore]) WHERE name='s1')
AND name='s1'
|
|
|
|
|
Thank you...
I will check what you said about ExecuteScalar...
I found the solution for the query. It should be like this:
SELECT [rawvalue] FROM [datastore] WHERE timestamp=(SELECT MAX(timestamp) FROM [datastore] WHERE name='s1')
|
|
|
|
|
Your query is may have some issues. What if two items with different names share the same timestamp?
|
|
|
|
|
Yes you are absolutely right....
but this query doesn't work.
SELECT [rawvalue]
FROM [datastore]
WHERE timestamp=((SELECT MAX(timestamp) FROM [datastore]) WHERE name='s1')
AND name='s1'
*******
Error in FROM clause: near 'WHERE'.
Unable to parse query text.
******
|
|
|
|
|
Too many brackets, remove one before the SELECT and the one after [datastore]
|
|
|
|
|
Its ok now thank you very much!
|
|
|
|
|
Is there a way to take an existing form and rerun the wizard if the data it's pulling needs to be tweaked?
-- modified at 11:04 Monday 14th May, 2007
Fixed subject
--
You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer
|
|
|
|
|
I haven't seen a way to rerun the wizard without scrapping the form and starting over.
|
|
|
|
|
Is there a way to set a form to only display data and not allow the user to change it?
--
You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer
|
|
|
|
|
Set all of the data entry fields to read-only by selecting all of the controls and setting the Locked property to Yes
|
|
|
|
|
Hello everyone!
Right now I've created a small Windows service that parses binary data files and stores information from there to a MS SQL Server database. Right now each file takes about 15 mins to parse, and that is about 3500 - 4000 INSERT statements.
I'm worried that this time gets bigger as the database grows. Okay, I don't have a production server and it all runs on a standard desktop-like hardware, but still 15 mins is way too much for 3000 operations.
Right now it uses CRecordset MFC classes, and this type of cycle running:
<br />
CRecordset db;<br />
db.Open()<br />
while (run)<br />
{<br />
db.AddNew();<br />
...<br />
db.Update();<br />
}<br />
db.close()<br />
Are there any ways to boost all this up? What I have in mind is switching to another technology (OLE DB or even a 3d-party classes like SQLApi), or implementing bulk inserts, but haven't yet found any good examples/articles.
I appreciate your help (or links) greatly!
--
Take care!
|
|
|
|
|
INSERT performance, in the long run, is going to depend on your database index structure. The more indexes you have on the fields of a particular table, the slower non-SELECT operations become because of the time required to maintain those indexes on every change in the database. Indexes speed up SELECT operations, but slow down everything else. You have to find a balance between the two that is acceptable to you.
|
|
|
|
|
Just over 3 inserts per second seems to be very slow indeed.
You should get better performance from using bcp.exe or DTS to do bulk inserts.
|
|
|
|
|
Hi Everyone:
I have designed a Windows data entry form that contains the following standard controls: 5 – labels, 1 – List box, and 4 –text boxes. The purpose of this form is to enter data into a single SQL server 2005 database table.
Visual Studio 2005 has a nifty control called the BindingNavigator. I would like to use this control so the user can add, edit, delete or just plain navigate though the data stored in the database table.
Does anyone know where I can find some step by step instructions on how to do this using VB.NET code? I tried using the connection wizard and couldn’t get it to work like I wanted it too.
Thanks in advance,
Quecumber256
|
|
|
|