|
Use identity columns so that the ID's are generated automatically.
|
|
|
|
|
Thanks AspDotNetDev, Its a high-end reqd to generate ID programmatically and not auto.
Thanks & Regards,
|
|
|
|
|
tell your customer that he made an request which is VERY EXPANSIVE to handle - he will agree with identity columns.
I cannot remember: What did I before google?
|
|
|
|
|
Well, then you have a serious design flaw in your database. One which will take a redesign to fix and a major overhaul of your code.
|
|
|
|
|
Thanks AspDotNet, Thomas, Dave.
>>One which will take a redesign to fix and a major overhaul of your code.
Dave, can you explain a bit on what are you trying to say and how and what factors to look for in the code.
Thanks & Regards,
|
|
|
|
|
Simple. Either you don't have a valid primary key (for example, the VIN is unique to each car, but you should never use it as a primary key) or your code is generating the key values (REALLY bad idea!).
In order to fix this you are either going to have to add proper primary keys to your tables, and update your code accordingly or you're going to have to add a layer to your database where every instance of your app is going to have to go through a singleton running on a server to have a primary key generated. Only one instance of your app is going to be able to call this singleton at a time which is going to kill your scalability. Oh, and you're still going to have to update your code to support this.
|
|
|
|
|
Thanks Dave for clean and clear explaination and how should I handle this.
Thanks & Regards,
|
|
|
|
|
hello guys,
i'm new to VB6 and crystal report, can somebody give tutorial on how to get a value from a textbox to be used in generating a report. this must be done when a button is click.
the scenerio is like this:
i have two textboxes(the from and to date) and a button. below is a crystal report viewer. what i want to do is to generate a report base from the from and to date. i hope you've got what i mean.
any help is appreciated. thanks and God Bless!
|
|
|
|
|
Don't repost your question.
I have answered your question in Q/A section. Clickety[^]
|
|
|
|
|
hey thatraja, do you know how to do this in vb6?
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim cryRpt As New ReportDocument
cryRpt.Load("PUT CRYSTAL REPORT PATH HERE\CrystalReport1.rpt")
Dim crParameterFieldDefinitions As ParameterFieldDefinitions
Dim crParameterFieldDefinition As ParameterFieldDefinition
Dim crParameterValues As New ParameterValues
Dim crParameterDiscreteValue As New ParameterDiscreteValue
crParameterDiscreteValue.Value = TextBox1.Text
crParameterFieldDefinitions = -
cryRpt.DataDefinition.ParameterFields
crParameterFieldDefinition = _
crParameterFieldDefinitions.Item("Customername")
crParameterValues = crParameterFieldDefinition.CurrentValues
crParameterValues.Clear()
crParameterValues.Add(crParameterDiscreteValue)
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)
CrystalReportViewer1.ReportSource = cryRpt
CrystalReportViewer1.Refresh()
End Sub
|
|
|
|
|
|
im having problem displaying the from and to statement. my report doesn't show anyrecord at all.
my selection formula record goes like this:
{Users.DateRegistered} >="{?FromDate}" and {Users.DateRegistered} <="{?ToDate}"
the two parameter fields(?FromDate and ?ToDate are both date type).
reportname: Report_DateFromTo
my vb code:
<br />
<br />
Report_DateFromTo.ParameterFields.Item(1).AddCurrentValue Me.DTPicker1.Value<br />
Report_DateFromTo.ParameterFields.Item(2).AddCurrentValue Me.DTPicker2.Value<br />
Me.CRViewer1.ReportSource = Report_DateFromTo<br />
Me.CRViewer1.ViewReport<br />
<br />
<br />
thanks
|
|
|
|
|
i made it!!! thankyou LORD!!! HE's really great!!!
|
|
|
|
|
Thanks in advance ,
I want to read pdf file,is it possible or i have to do it by using any third party component If third party component then any suggestion will be highly appreciated.Did some surfing but found nothing helpful
SOFTDEV
Luck in life always exists in the form of an abstract class that cannot be instantiated directly and needs to be inherited by hard work and dedication.
|
|
|
|
|
This[^] may help, This will also[^] give you some pointers.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
http://www.developerfusion.com/tools/convert/csharp-to-vb/ - csharp to vb
http://www.blackbeltcoder.com/ - adohelper class c#
http://www.daniweb.com/software-development/csharp/code/216893 bubble sort
Read file
Dim fileContent As String = File.ReadAllText(filename)
Dim integerStrings As String() = fileContent.Split(New Char() {" "c, ControlChars.Tab, ControlChars.Cr, ControlChars.Lf, ","}, StringSplitOptions.RemoveEmptyEntries)
Dim integers As Integer() = New Integer(integerStrings.Length - 1) {}
Dim IntIndx As Integer = -1
'Dim Intvalid As Boolean = False
Dim TestInt As Integer = 0
For n As Integer = 0 To integerStrings.Length - 1
Try
'Intvalid = False
TestInt = Integer.Parse(integerStrings(n))
'Intvalid = True
IntIndx += 1
integers(IntIndx) = Integer.Parse(integerStrings(n))
Catch ex As FormatException
Debug.Print("Item contains invalid characters for an Integer" & integerStrings(n))
Catch ex As OverflowException
Debug.Print("Item too Large for an Integer" & integerStrings(n))
End Try
Next
Return integers
Dim numbers As Integer() = ParseNumberFile("c:\test\infile.csv")
Console.WriteLine("No of Integers Read : " & numbers.Length)
Write file
Dim objFS As New FileStream(strFileName, FileMode.Create, FileAccess.Write)
Dim objSW As New StreamWriter(objFS)
Dim arStrings As String() = New String(arIntegers.Length - 1) {}
For fint = 0 To arIntegers.GetUpperBound(0)
arStrings(fint) = arIntegers(fint)
Next
strintegers = Join(arStrings, "|")
' Write out the record to the file ...
objSW.WriteLine(strintegers)
Console.WriteLine("Record was written to the output file.")
Console.WriteLine("")
objSW.Close()
Console.WriteLine("")
Console.WriteLine("File creation complete. Press Enter to close this window.")
Console.ReadLine()
End Sub
Dim qry As String = ""
Dim adoconnectionString As String = ""
Dim paParams() As Object = Nothing
Dim objRow As DataRow = Nothing
Dim dsData As DataSet
Dim sDescription As String = vbNullString
Using db As New AdoHelper(adoconnectionString)
dsData = db.ExecDataSet(qry, paParams)
If dsData.Tables(0).Rows.Count > 0 Then
For Each objRow In dsData.Tables(0).Rows
If Not objRow("Description") Is System.DBNull.Value Then sDescription = objRow("Description")
Next
End If
End Using
|
|
|
|
|
...and the question would be ....??
Edit your post, enclose the code in PRE tags, removing all the extra blanks lines, and only include the code that pertains to the question.
|
|
|
|
|
That is unreadable without proper PRE tags.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
I've been trying to multi-thread a windows service with no luck...it actually goes slower.
We have a table on another SQL DB server (linked to our SQL Server) that contains the keys (SSN & ID, multi SSN & unique ID for the SSN) that we need to process.
Server A is the one we're linked to and getting data from.
Server B is the one we're adding/updating data to.
We read an SSN/ID on server A, get related data for them from server A and update/add to server B. The update/add on server B is with LINQ via VB.NET (not a fan of that (LINQ that is)).
Have tried at least 3 different ways to thread this, all with negative results and can't find a good example.
Also, even when single threaded, it runs slower the longer it runs (85 hrs, starts at about 7000 recs/hr, and ends at about 1200/hr)
Any ideas or point me in a direction?
Thanks.
modified on Friday, May 20, 2011 2:28 PM
|
|
|
|
|
Multi-threading isn't the magical cure to everything. It works well in a lot of situations, and doesn't at all in others. That is due to either the problem being inherently sequential, or the design or implementation being flawed. From what you told us I can't tell which applies to your case.
Here are some suggestions:
- implement it without multi-threading, run a relevant test case, and observe the behavior. In particular look at the CPU load in Task Manager; if it is less than 100% divided by the number of cores, it probably could benefit from multi-threading; and if it is close to 100%, multi-threading will not help at all.
- make sure it isn't as fast as you would like, then make sure you have optimized everything you could reasonably optimize; choose the proper algorithm; apply proper indexing to the database; etc etc. Also make sure you don't have busy loops, i.e. things such as:
while(!done) }
if (newDataAvailable) }
...process new data
}
}
which would spin (and waste cycles) at maximum speed as long as no data is available.
- once you really understand there are blocking calls (waits) that could be hidden (by processing other data in the mean time), start designing a multi-threading approach, at best by just adding a single thread and making sure it meets your expectations.
- then think again about having maybe some more threads.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Do I understand that your service has one connection string and it is connected to Server B ?
When you are accessing data you get the results from a table that is stored on a linked server.
You issue an update to some table on server B with the results obtain from the linked table.
Is the above correct ?
I'm unclear as to where the problem is ... is this a database issue or a multi-thread problem ?
Suggestion:
Is it possible to have 2 connection strings one for each server and not rely on the "linked data" ?
I'm not sure how you are processing your updates, but maybe you could get all your data from the linked server, copy it to a Temp table, then use an update from that Temp table to the table on server B. This would reduce the number of SQL calls.
sounds like a complex problem, but I don't know where to begin to offer advice.
Post some more info and everyone here will try to help you.
Good luck.
|
|
|
|
|
Hi,
I have installed VS2010; now I have only FW4 as posibility for my projects.
So when I open an older project it will not load.
I have click on add other frameworks but no luck.
Can someone help me
Jan
PS VS2008 was installed also
|
|
|
|
|
I draw your attention to This[^] page.
A snippet...
"Application Compatibility and Deployment
The .NET Framework 4 is highly compatible with applications that are built with earlier .NET Framework versions, except for some changes that were made to improve security, standards compliance, correctness, reliability, and performance.
The .NET Framework 4 does not automatically use its version of the common language runtime to run applications that are built with earlier versions of the .NET Framework. To run older applications with .NET Framework 4, you must compile your application with the target .NET Framework version specified in the properties for your project in Visual Studio, or you can specify the supported runtime with the <supportedRuntime> Element in an application configuration file.
If your application or component does not work after .NET Framework 4 is installed, please submit a bug on the Microsoft Connect Web site. You can test compatibility as described in the .NET Framework 4 Application Compatibility topic and learn about new features by using the Visual Studio 2010 and .NET Framework 4 Walkthroughs. For additional information and known migration issues, visit the .NET Framework Compatibility blog."
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
I am not sure who upvoted you, DD, but that is not a good answer. The OP is not talking about an app targeting an earlier version of .Net that is not working on .Net 4. The OP is talking about not even being able to create an app targeting an earlier version of .Net.
|
|
|
|
|
Do you have the older frameworks installed? .Net is completely autonomous and does not need previous frameworks to work, so you may have to install them. When you create a new project, there is a little drop down at the top of the window that allows you to select the framework. "More Frameworks" should be an option and it will send you here. The right of the page lists older frameworks you can install. Note that .Net 3 and 3.5 require .Net 2.
Also, if you are using an Express edition, I am not sure if that supports the old frameworks or not.
|
|
|
|