|
Well, for that reason you can add another column to the table, lets say OrderNrOfDay.
Every time you insert the order in the table, check if the date today is same as that of the last order. If yes, the increment the OrderNrOfDay else set it to 1.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Thank You Manas
That makes sense, let me try that should fix me.
|
|
|
|
|
That's again problematic. You should take extra care to make the increment atomic as multiple users will be using the web site simultaneously. Your client's idea of resetting the order numbers to 0 each day is plain stupid. In such case, how do you refer to a order? You may need order number and the day order placed.
The option 1 suggested in the other reply is good. I am not getting what is the issue you are facing with that approach?
|
|
|
|
|
I accomplished this task by creating another table which has OrderId,OrderNum, Date, OrderNrOfDay. OrderNum is the FK here to PK of orders table.
Then OrderNum from marchant warehouse is always saved in database and for clients sake generating daily order numbers starting from 1 to so on and for records we have OrderNum.
This solved the issue.
|
|
|
|
|
Hi,
Guys I have a peculiar problem here, I need to display data from two tables having no fields at all common and want to display them in one gridview on the click of a radio button .
If radiobuttton(1) is selected then data from table one will be displayed and if radiobuttton(2) is selected then data from table two will be displayed.
each of the table is having field name as:
table(1)
fname lname mname abid
table(2)
fname lname mname cdid
is there some advice you guys can help me?
thanks
|
|
|
|
|
this seems easy enough to me. Change the data source of the gridview on the event of the radio button being clicked
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi Chris,
The problem is that even if I change the data sources ,the gridview which I am using has only one name(name of the coloumn here) so how will the grid view show second table's data?
|
|
|
|
|
each of the table is having field name as:
table(1)
fname lname mname abid
table(2)
fname lname mname cdid
gridview
fname lname mname abid
Now as you can see the gridview has a field name abid and this field is databound that is it has to have the same name as that with the respective table, so by my limited knowledge this gridview will show only one table's data but I want to display data of two tables in one gridview.
Is there a way out from this problem?
|
|
|
|
|
you have to change in select Query Like this .
for table(1) use the following Query.
select fname,lname,mname,abid from table(1)
and for table(2) the select Query will be.
select fname,lname,mname,cdid as abid from table(2)
now u have the same column name for both tables.
and if u want to change the headerText text of the column with condition of radio buttons.
after data bound like this.
GridView1.DataBind();
if (RadioButtonList1.SelectedValue == "one")
{
GridView1.Columns[3].HeaderText = "abid";
}
else
{
GridView1.Columns[3].HeaderText = "cdid";
}
|
|
|
|
|
How to select and return more than one values using select stored procedure.
How to configure login control using wizard.
How to edit connection string at configuration file or how to change database name, server name, username nad password.
|
|
|
|
|
I think you need to read my article on how to use google. Or perhaps try asking detailed, intelligent questions. You've asked three very different things. In each case, I have to ask, where are you stuck ? Do you not have any books on ASP.NET ? Do you not have access to google ? Have you tried reading some articles on the site ?
What have you tried ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Christian Graus wrote: I think you need to read my article on how to use google
I feel that people just post a question at CP and go for a coffee break.
And boy, they have the answer by the time they come back.
So, it like why should I take any pains when someone else can do it for them.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
It sure looks that way.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I would rather suggest to buy a beginners’ book and start reading.
The questions you have asked are very basic and it would be difficult for you to continue with the task.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hi,
Mix Wheels wrote: How to select and return more than one values using select stored procedure.
ANS 1 : Ans1[^]
Mix Wheels wrote: How to configure login control using wizard.
ANS 2 : Ans2[^]
Mix Wheels wrote: How to edit connection string at configuration file or how to change database name, server name, username nad password.
ANS 3 : Ans3[^]
See and try using the same method from GOOGLE and then post questions when you have any errors or if you stuck anywhere.
Hope you got it....
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
Hi everybody,
I've written this code for publish reports on ReportServer.Everything is ok, but if I have SharedDataSource it says:
---------------------------
The dataset ‘NewDT’ refers to the shared data source ‘NewDT’, which is not published on the report server.
---------------------------
what's wrong?
Dim TmpEncoding As New System.Text.UTF8Encoding
Dim TmpReportDefinition() As Byte = TmpEncoding.GetBytes(PRdl)
Dim TmpWarnings() As Warning = TmpRsProxy.CreateReport(PReportName, PParentPath, True, TmpReportDefinition, Nothing)
Dim TmpDataSources As DataSource() = TmpRsProxy.GetItemDataSources(PParentPath & "/" & PReportName)
For Each TmpDataSource As DataSource In TmpDataSources
Dim dSource As New DataSource
Dim dDefinition As New DataSourceDefinition()
dSource.Item = dDefinition
dDefinition.Extension = "Sql"
dDefinition.ConnectString = "Data Source=" + ClsSetting.DbServerName + ";Initial Catalog=" + ClsSetting.DbName
dDefinition.ImpersonateUserSpecified = True
dDefinition.Prompt = Nothing
dDefinition.WindowsCredentials = True
dDefinition.CredentialRetrieval = CredentialRetrievalEnum.Integrated
dSource.Name = TmpDataSource.Name
Try
TmpRsProxy.CreateDataSource(dSource.Name, ClsSetting.DataSourceLocation, True, dDefinition, Nothing)
If TypeOf (TmpDataSource.Item) Is DataSourceReference Then
Dim DsReference As New DataSourceReference()
Dim ds As New DataSource
DsReference.Reference = ClsSetting.DataSourceLocation + "/" + dSource.Name
Dim DataSources() As DataSource = TmpRsProxy.GetItemDataSources(PParentPath & "/" & PReportName)
ds = DataSources(0)
ds.Item = CType(DsReference, DataSourceReference)
ds.Name = TmpDataSource.Name
TmpRsProxy.SetItemDataSources(PParentPath + "/" + PReportName, DataSources)
End If
Catch ex As System.Web.Services.Protocols.SoapException
Throw ex
End Try
Next
</pre>
<div class="ForumSig">Best wishes</div>
|
|
|
|
|
Hey,
here is one solution you may need the same.
Try it[^]
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
How to add database name, server name, username, password to the connection string configuration file when you compiling the website.
And How to convert from object of class where you add parameter to the list<perametertype>.
Phumlani Sandile Kunene
Country South Afica
Province KwaZulu Natal
City Vryheid
Township Emvuyane, eS'mashwini
Room number 540
|
|
|
|
|
I don't understand the question. When you compile is not the time to add to the config file.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Phumlani Kunene wrote: How to add database name, server name, username, password to the connection string configuration file when you compiling the website.
This one[^] tells you every thing about Connections Strings
Phumlani Kunene wrote: And How to convert from object of class where you add parameter to the list.
What to you want to convert?
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
In my application i want to attach a file of (.xls) type.which is created from a grid view.how to achieve it.
|
|
|
|
|
Not sure how this is ASP.NET related, but, how are you sending email, that this isn't easy ? I just add to the Attachments collection on the mail class.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi,
if you are having any file.
You can use This[^] links to get your answer..
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
suppose i have a gridview and it contain 3 column first column contain userid,second column contain linkbutton and third column contain text locked but it is not visible.and now i want update user information of locked on clicking linkbutton.
how is it possible?
please help me.
|
|
|
|
|
I don't think I understand your question. you seem to me to be asking how to update some text on a click event. How is that hard ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|