|
Hi Everyone:
I’m still struggling with the BindingNavigator control in Visual Studio 2005.
What I want to do is create a DataSet and populate it with data retrieved from a specific database table using a stored procedure. The code to accomplish this part is shown below.
'Connect to the database
Dim cn As SqlConnection = New SqlConnection()
cn.ConnectionString = My.Settings.DBConnectionString
'Retrieve the data using a stored procedure
Dim cd As New SqlCommand("mrmsp_ListBinding", cn)
'Declare the SQLDataAdapter and DataSet
Dim MySqlDataAdapter As New System.Data.SqlClient.SqlDataAdapter()
Dim MyDataSet As New System.Data.DataSet
'Set the database connection for MySqlDataAdapter
MySqlDataAdapter.SelectCommand = cd
'Fill the DataSet
MySqlDataAdapter.Fill(MyDataSet)
Now I need to set the BindingNavigator's DataSource to the DataSet we created as shown below.
'Set the BindingNavigator's DataSource to the DataSet we created.
naviBindings.BindingSource.DataSource = MyDataSet
This is where I’m running into trouble. I have a form that contains four text boxes. I want to bind each of these text boxes to a different field from the DataSet I created. A simple example would be:
TextBox1 = DataSet.Field1.Value
So First Question: How do I bind specific database fields from a DataSet to a specifc control on the form using VB.NET code?
Thanks,
Quecumber256
|
|
|
|
|
TextBox1.Text = DataSet.Tables[0].Rows[rowno][columnno].ToString()
Gautham
|
|
|
|
|
hello,
I want to use row and column in winform, it fill by user at runtime and save to database...:laugh
|
|
|
|
|
|
what is the solution to the timeout problem while filling some dataset using sqldataadapter.When the query tested in query analyzer generates result set after considerable time duration (like 20 seconds) .while the application doesnt stay for that long thus leaving the dataset empty .I also changed timeout value in web.config but it didnt work .
Madni
|
|
|
|
|
give a snapshot of your code
|
|
|
|
|
Hi.
What model should I use to handle both named and unnamed parameters depending on the type of db engine my program connects to?
|
|
|
|
|
The Enterprise Library (downloadable from Microsoft's website) allows you to create parameters independent of whether they are named or not (or even if the naming convention is different)
|
|
|
|
|
Thanks. I'll check that out.
|
|
|
|
|
I am using SQL Server 2000. I need get location of a specific character. How can I do this in SQL Server ? Indexof function is there ?
My string will be '522-hhdsh-' I need to find '-' position in one query.
|
|
|
|
|
use charindex e.g
SELECT charindex('-','522-hhdsh-')
|
|
|
|
|
Thanks. That worked
|
|
|
|
|
How to store an Audio file in SQL Server 2000
Thanks
|
|
|
|
|
Use a field of type "Image".
|
|
|
|
|
|
I would like to loop through a SQL Server table that contains the paths to all the reports(SSRS) we need to run and then execute the reports via SSIS. What task should I be doing to do this? Will the For Loop work for something like this? Please Explain in Detail if possible Or either Explain me how to run a Report from SSIS
-- modified at 1:24 Tuesday 15th May, 2007
|
|
|
|
|
Why do you need to do something like this?
|
|
|
|
|
I need to execute a set of reports from SSRS and send it to a list of mail-Id's . This reports will be attachments of the mail (All reports will be send as one attachment) . This need to be scheduled and should be done every day after another package is run by the Sql Job Agent
|
|
|
|
|
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;
*************************
|
|
|
|
|