|
Sorry
The "isAdministrator" returned null value!
|
|
|
|
|
|
Solve what? You haven't said what the problem is. We can't read your mind or see your screen so you have to explain it to us.
|
|
|
|
|
Okay, Fine!
I'm sorry!
|
|
|
|
|
Your code is vulnerable to SQL Injection[^].
NEVER use string concatenation to build a SQL query. ALWAYS use a parameterized query.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Can I use WM_CTLCOLORSCROLLBAR for changing VSFlex Grid's Scroll Bar?
Please kindly give me some advice?
|
|
|
|
|
when some one changes the status: as 'Getting Daily Feed' in addition to saving the status as of now we need to call following URL is '(http://dev.bullseyeprospecting.com/api/dealer/saveevent?dealerGuid=&eventCode=A&userid=5212404' .
How can i do this in wcf .
|
|
|
|
|
Yeah, that made no sense at all.
We have no context information, nothing about your application, the details of exactly what you're trying to accomplish, what the problem is, ... nothing.
|
|
|
|
|
I have a dropdown name PER-PS 101 report. When I click view report it supposed to show the report if have values and "No records found for the selected criteria" if no data between the selected date. But in my case, if there is no data, its showing missing parameter error.
Below is the code:
Private Function ShowICDReport101() As Boolean
Try
Dim MessageString As String
Const ReportName As String = "ICD_InpatientReturn_Main.rpt"
Dim ReportDocumentObject As New ReportDocument
Dim ReportParametersListObject As List(Of ReportParameters)
Dim CrystalReportHelperObject As New CrystalReportHelper
'Dim ds As New DataSet
Dim ReportFilePath As String
ReportFilePath = CrystalReportHelperObject.DeploymentPath("CrystalReportsFilePath") + ReportName
ReportParametersListObject = SetReportParameters()
'To call the CheckReportData() function
If CheckReportData(ParentFormController.DateByMonthDateTimePicker.Value.Month.ToString(), ParentFormController.ToYearDateTimePicker.Value.Year.ToString(), ApplicationHelper.UserId) = True Then
ReportDocumentObject = CrystalReportHelperObject.GetCrystalReportDocument(ReportName, ReportParametersListObject)
If ReportDocumentObject.HasRecords = True Then
ParentFormController.ShowCrystalReportInViewer(ReportDocumentObject, "ICD Healthcare Facilities for Inpatien Returns", False, String.Empty)
Else
MessageBox.Show(MessageString, "Care21", MessageBoxButtons.OK, MessageBoxIcon.Warning)
End If
Else
MessageString = "No records found for the selected criteria"
MessageBox.Show(MessageString, "Care21", MessageBoxButtons.OK, MessageBoxIcon.Warning)
End If
Catch ex As Exception
Throw
End Try
End Function
Public Function CheckReportData(ByVal Month, ByVal Year, ByVal Userid) As Boolean
Dim ReturnCode As Boolean = False
Dim ReturnValues As New Dictionary(Of String, Object)
Dim result As Boolean
Try
Dim DbObject As Microsoft.Practices.EnterpriseLibrary.Data.Database = DatabaseFactory.CreateDatabase()
Dim DbCommand As DbCommand = DbObject.GetStoredProcCommand("usp_Rpt_InpatientReturns")
Data.AddInParameter(DbCommand, "@paMonthIn", DbType.String, Month, DbObject)
Data.AddInParameter(DbCommand, "@paYearIn", DbType.String, Year, DbObject)
Data.AddInParameter(DbCommand, "@paUserIdIn", DbType.String, Userid, DbObject)
Dim dt As DataTable
Dim ds As New DataSet("tt")
Dim DataReaderObject As IDataReader = DbObject.ExecuteReader(DbCommand)
dt.Load(DataReaderObject) 'If DataReaderObject.FieldCount = 0 Then
'Else
'End If
If dt.Rows.Count = 0 Then
result = False
Else
result = True
End If
DbCommand.Parameters.Clear()
'If ReturnValues("Result").ToString().Equals("1") Then
'Return True
'Else
' Return False
'End If
Catch ex As Exception
Throw
End Try
Return result
End Function
|
|
|
|
|
Running from your message that is displayed. I am assuming that this is the if check that is run before the message is displayed.
Member 11727014 wrote: If CheckReportData(ParentFormController.DateByMonthDateTimePicker.Value.Month.ToString(), ParentFormController.ToYearDateTimePicker.Value.Year.ToString(), ApplicationHelper.UserId) = True Then
Have you checked to see what the values that these parameters have before the function is run? Also what is ParentFormController.DateByMonthDateTimePicker and ParentFormController.ToYearDateTimePicker.Value.Year.ToString() ? are these controls?
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
Check your underlying data set, retrieved using usp_Rpt_InpatientReturns - sometimes a misspelled column name will generate an invalid parameter message
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
i'm using Visual Basic 2010 with database of Microsoft Access 2007 . how can i print the data in datagridview? (the column was 10 and the row was many because they always add a new data )thank you
|
|
|
|
|
|
Hello !
I have an application in vb.net 2013 and sql server 2008r2 and Entity Framework 6.0.
I'm trying to implement a "Event Log" feature in my application.
Actually :
I have an Event table in database that will keep all the activities (with details) that a user has done in this database from my application.
The only problem I have is this :
One of the field in the Event table is ObjectID , that is supposed to keep the id of the record that is related with that event.
But the problem is that how this Event will going to be read.
Because for example :
Event1 ... may be related with Clients table , with a record with ID=25
Event2 ... may be related with Articles tables , with a record with id 40
......
In this case , I can't use a foreign key with the field ObjectID because it need to be flexible ( related with different tables ) and I don't know if this is possible.
But also , if I keep only the id , and add another field that keep the table name , how can I read with entity framework ?
Any suggestion will be very helpful.
Thank you !
|
|
|
|
|
satc wrote: In this case , I can't use a foreign key with the field ObjectID because it need
to be flexible ( related with different tables ) and I don't know if this is
possible. I'd recommend looking into 'normalization', a modelling technique for databases that helps a lot in these cases.
Add the table-name a a field to the event-table; the Id and tablename together would make each record unique. Since you don't want to repeat the table-name for each record, I'd suggest putting the table-name as a KeyPairValue (int/varchar) and link to that from the event-table.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy, I noticed you overlooked this part of his question - do you have a suggestion for that? (I don't)
Quote: But also , if I keep only the id , and add another field that keep the table name , how can I read with entity framework ? (Presumably as in "read the referenced record though it's not referenced by a foreign key")
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
I don't see why it wouldn't be able to read it back.
In the worst case scenarion one would open an SqlConnection outside of EF, connect, read the id and tablename - and build a new command.
There's offcource no way to use a fieldname in the place of a table-name.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
SqlConnection outside EF - check.
But how could the non-worst case look like? (Maybe I'm having a stupid moment..)
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Sascha Lefèvre wrote: But how could the non-worst case look like? I don't have experience with EF; in the best case it would pick up the new column-name in the database, update the model and generate new entities. That would making reading the table easier for someone who is used to EF. To me, it is merely a select-statement.
The main problem here is getting the table-name (data) back into the sql-command. That is not something that can be done in Sql (unless you go to, spit, dynamic sql) and should be done in the codelayer above.
Make a new command, say "I need from table x the Id y" and of you are.
Sascha Lefèvre wrote: (Maybe I'm having a stupid moment..) Noes, you're not. I'm a bit more confused than usual, having trouble concentrating. Doesn't mean I'm not going to try
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Alright
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
The problem is that as I know , the entity framework doesn't have a way to read where the entity name is variable :
Dim Ename as string
......
......
Dim query=From t in context.[Ename]..... select t
Can this work ?
|
|
|
|
|
No, that wont work.
There isn't really an EF way to do this. You'd need a switch and a separate function for each table type just to do the lookup and return the correct object type.
|
|
|
|
|
Alternatives:
- nullable references to every "regular" table in the event-table of which only one would be non-null
- a separate event-table for every "regular" table
edit: I realized I expressed this in terms of conventional, relational db design. In EF/ORM terms: You could have an abstract Event-entity and then derive concrete Event-entity-classes for each "regular" Entity.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
modified 29-May-15 19:43pm.
|
|
|
|
|
Thank you for your alternatives.
But :
- If I create a FK for each table in the Event table , the event table will became very huge . Imagine 80-90 Fields only for these FK.
- If I keep a event table for each table then , will be more complicated :
Imagine 80-90 tables more on my database , and what about a query like this : " Display all the events in database on date 1/1/2015 " And after creating a report with these ???
Well , if these are the only solutions , I should choose ??!!
I'm curious which is the better way , because this problems about keeping an event table I think may be problems for other developers too.
|
|
|
|
|
Did you see my addition to my previous message? If you create an abstract Event-base-entity and derive concrete Event-entities for the "regular" tables from that, you can query all events, regardless to which table they belong.
The abstract Event-base-entity would hold all the information about the event, the derived concrete Event-entities only a reference to the record to which the event refers.
Query-examples:
DateTime dayOfInterest = new DateTime(2015, 1, 1);
var events = context.Events.Where(e => e.Date == dayOfInterest);
var allUserEvents = context.Events.OfType<UserEvent>();
Whether the concrete Event-entities end up in separate tables or in one table depends on which type of inheritance-mapping strategy you choose: Table per hierarchy (a single table for all events) or one of the other two (see http://weblogs.asp.net/manavi/inheritance-mapping-strategies-with-entity-framework-code-first-ctp5-part-1-table-per-hierarchy-tph[^]).
Regarding the creation of a report I have to completely pass.. but I can't imagine that the above idea would be a general problem for report creation.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|