|
hai all,
i am using dotnet 2005.i doing my project in vb.net windows application.
Is it possible to generate serial number in datagridview.if possible means,i want to generate serial number in datagridview by descending order in windows application,not in web application.
|
|
|
|
|
Sure, you have complete control available to you. However you should make the changes in your datasource not the datagridview. IE when you add a row make the change at the row level.
Beware if you are adding an "identity" value that is not controlled by your datasource (database) you are asking for trouble.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
For doing that in the DataAdapter you add a column.Let its name be sno.Then you change the autoincrement property of that column to true.Set auto incrementSeed as a number(For ex: 0) from which number you want to start numbering.Change datatype to System.Int64.
While binding the datagrid with that adapter the column numbers will come..
|
|
|
|
|
Hi
I have two questions regarding WebBrowser Control.
Is there any way to control the class attributes of an html document in WebBrowser control?
And once I have modified some html inside the WebBrowser control's Document then when I am retrieving WebBrowser1.DocumentText property, it is just showing the un-modified version, however, if a get WebBrowser1.Document.body.OuterHTML property then it is displaying all the changes. How can I simply get the complete modified version of that page?
Regards,
MAP Tiger
Tiger Softwares
Software Designer and Developer
VB.NET, ASP.NET, VFP
|
|
|
|
|
You can use CSS Class(Cascading Style Sheet) for control it.
|
|
|
|
|
Hi
Thanks for the reply.
Can you also please guide me a little more that where can I find information on this class, I am doing VB.NET windows forms application and using Microsoft's WebBrowser control.
Regards,
MAP Tiger
Tiger Softwares
Software Designer and Developer
VB.NET, ASP.NET, VFP
|
|
|
|
|
I have a child form in an MDI application. Before I show the child form I set its location as following:
Dim location as Point = new Point(me.SplitContainerRight.Right + 10, me.SplitContainerRight.Location.Y - 10)
child.Location = location
This does not work the first time the form loads, but works every 2nd try after that. For example, first it does not work, 2nd time it does work, 3rd time it does not work and so on.
I did debug.writeline and it gives me different co-ordinates for child.Location every alternate show.
Any ideas? Code is the same but it only sets location sometimes. Oh yeah, form is On Manual start up.
|
|
|
|
|
I keep coming back to this one, I don't use MDI but the 2 action process brings the event orders to mind. If you use the selectedindexchange on a list control it fires the event 2 times for each row change, 1st to remove the selection and the 2nd to apply the next selection. Could this be the culprit with your forms. What event are you using!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Very good guess. I am using a button click event but events are not the cause. It's the weirdest problem. When I am debugging I have a watch on child.Location and also the new location. I step over and the new location does not get assigned to the child.Location for some odd reason. On the next try it does assign it and then again it doesn't.
I am totally lost!
|
|
|
|
|
I can't seem to duplicate this but I can tell you that you need to set the location of a form after you call the form.show methode (if you do it before it doesn't work (at least not at my end))
|
|
|
|
|
The problem was WindowState should be set to Normal and before I had it sit to Maximized---URRRRRRRGH. Still confused as to why this property will prevent the form from displaying at the correct location.
|
|
|
|
|
Don't ya hate it when it is the simple ones, one of the reasons I like working with a team is that I can bounce the problems at them before resorting to CP (public humiliation);P
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
For the last two months I have been fighting an issue with a multithreaded vb.net progran that for no apparent reason goes into a deadlock condition. When the progrm enters this state the only way to break the deadlock is to doubleclick on the main screen and then the screen goes black and a second later the program returns to a normal state and all is well. This typically hapens after about six hours of runtime and the process is in cycle doing measurements and reporting results. Any ideas would be greatly appreciated.
rcombs
|
|
|
|
|
The action of double clicking the main screen obviously changes some state somewhere which causes one of the threads to stop interfering with another.
My suggestion is to follow through on the debugger the event that handles the double click event and see what it changes that releases the deadlock.
|
|
|
|
|
Please I'need help.
how to call my stored procedure in SQL 2000 using VB.NET 2008
with parameter, date range.
thank you
|
|
|
|
|
|
|
|
So? It's the same general idea.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Very Easy.
Dim con as SQlConnection(ConnectionString)
con.open()
dim cmd as new sqlcommand("StoredProcedureName",cn)
cmd.CommandType=Commandtype.StoredProcedure
'if Stored procedure return rows
dim dr as sqldatareader=cmd.ExecuteReader
'if Stored procedure do not return rows then
cmd.executenonquery
'if stored procure has parameters
cmd.parameters.add(new sqlparameter("@parameterName1",value))
cmd.parameters.add(new sqlparameter("@parameterName2",value))
..........................
'then excute it by Executereader or executenonquery
Hope This will solve your problem
|
|
|
|
|
Thank you for you help me,
I'm run this but return this msg:
Syntax error converting datetime from character string.
I'have this format in my SQL data base field
2005-06-21 00:00:00.000
I'have in my form two datetimepicker
cmdOrders.Parameters.Add(New SqlParameter("@StartDate", Dtpicker1.Value))
cmdOrders.Parameters.Add(New SqlParameter("@EndDate", Dtpicker2.Value))
how format the date.
thank you.
|
|
|
|
|
There is a lot of documentation and examples already available covering what you are asking for. Specifically what is it that you have problems with?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I'have this.
Dim sConnectionString As String = _
"server=rs500001\rptsrv;uid=user;pwd=pass;database=rpt"
Dim cnNorthwind As New SqlConnection(sConnectionString)
Dim cmdOrders As New SqlCommand("sp_Sales", cnNorthwind)
cmdOrders.CommandType = CommandType.StoredProcedure
cmdOrders.Parameters.Add(New SqlParameter("@StartDate", SqlDbType.DateTime))
cmdOrders.Parameters"@StartDate").Value = "2008-01-01"
cmdOrders.Parameters.Add(New SqlParameter("@EndDate", SqlDbType.DateTime))
cmdOrders.Parameters("@EndDate").Value = "2008-0-10"
I'm using SQL 2000 and VB.NET 2008, but this not work, I'm want run my stored procedure, the name for this is "sp_sales".
thank you
|
|
|
|
|
reynaldosp wrote: but this not work
That's not a useful description. What happens? Does it compile? Do you get an error message? What do you expect it to do, what does it do, and how does that differ from what you expect?
reynaldosp wrote: cmdOrders.Parameters"@StartDate").Value = "2008-01-01"
You are missing a starting parenthesis after cmdOrders.Parameters.
As the data type for the parameter is DateTime, you should assign it a DateTime value, not a string.
The Add method returns a reference to the parameter, so you don't have to access it by name. Also, it has an overload that creates the parameter for you.
cmdOrders.Parameters.Add("@StartDate", SqlDbType.DateTime).Value = new DateTime(2008, 1, 1)
reynaldosp wrote: cmdOrders.Parameters("@EndDate").Value = "2008-0-10"
That's not a valid date. I suppose you meant "2008-01-10"?
cmdOrders.Parameters.Add("@EndDate", SqlDbType.DateTime).Value = new DateTime(2008, 1, 10)
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I hope they were typos in the message posted and not the code he was trying to compile.
Never underestimate the power of human stupidity
RAH
|
|
|
|