ProtectedSub Page_Load(ByVal sender AsObject, ByVal e As System.EventArgs) HandlesMe.Load
Dim a AsNew DataSet1.TasksDataTable()
Dim adp AsNew DataSet1TableAdapters.TasksTableAdapter
GridView1.DataSource = a
GridView1.Visible = TrueEndSub
I created a dataset in visual studio by drag n drop. It has got two tables: Tasks and Reply. I saved the dataset by name Dataset1.xsd.
The problem is that the gridview doesn't show up at all. without throwing any errors.
[I am trying to bind a gridview from a table and updation records in another table]
Actually I have two sql tables, named mtblVehicle_Booking and mtblLog_Book. In both tables all columns are same but mtblLog_Book is having 2 more columns KM_Start and KM_End.
Actually I am binding the gridview from mtblVehicle_Booking table (which don't have KM_Start and KM_End columns). The other side I have given edit option in gridview, but when I need to edit this gridview , the colums KM_Start and KM_End should come in that gridview as editing form and after updating the gridview the updated information should be seen in the gridview.
How can I accomplish this.
you can take it as a Gridview bounded with one table but when it gets update this should be partially bounded with the other table with updated information and rest of the gridview should bounded with the first one.
Suppose if gridview is having 5 rows from table1 one and if I edit two rows for updation the table2 then the gridview should show these 2 rows from table2 and the rest rows from table1 which actually has bot been updated.
At any rate I wanted to add Facebook login to my (personal) website and didn't want to use the build in authentication (why bother the user with one more very forgettable useless password?)
So I deleted all authorization code and I have an account controller which take the facebook id and check it against Facebook server and set up a Session property with relevant Facebook data
now when I add an [Auhorize] attribute on my method it doesn't work (normal)
I wonder how I could setup the user!
I have code which create an IPrincipal (from facebook info) and set it to the HttpContext.User but it's lost on next query.
I tried override myControl.Initialize(RequestConterxt) and setup the current user (as in request.HttpContext.User = ...)
But I got a stranger error when I do that (which involve none of my code!!!!!):
I am working on an mvc site. I understand the concept of the Model, however we are forced to work with the existance of our main frame. The data comes back in the form of a parameter block (fixed structure defining each field and it's length). This transaction to the mainframe would occur outside the controller (obviously). So to move the data from the transaction to something the controller uses can either be done with it's own class (my company calls them entities) or to double purpose the model as the information from the mainframe would basicaly (with same additions) be the fields of the model. Hopefuly all that made sense.
So the question is: do I create entity class and transfer all the data(properties) into the model after every tranasction once the fields are returned to the controller or do I double purpose the model by using it as the entity as well with the understanding that these fields that aren't to be used in the view would show up because the model fields and entity fields are mingled together?
Any advise would be greatly appreciated...
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
I am migrating my DB from a C++ Structure system to SQL. As an example, I take the 'Order Table'
The CPP struct for an Order comprises of a header, containing all sorts of usefull info, like who owns it, who donne it,how many items, followed by an array of 32 possible 'Order Items', each containing amongst others: a TimeStamp, A Quantity, a narrative, an amount, and a WhoDunneit, as wel as obscure CPP management information to avoid data clashes.
This goes together with carefully crafted rules about who can edit what. (Each user can only edit own items, but suitably empowered supervisory personell can edit all entries.)
The method that worked best was what we called the 'Pragmatic Upate' The Update that updates from the original datafirst, wins. All others fail, and get a view of the latest version. Does SQL act like this, or do i need tricks to implement this.
The table was stored in a file,as an array of structures of this kind.
I hope to re-write the new version in C# ,ASP.NET.
First Stumbling Block: how do I create my array of items in an SQL Database. (come to think of it, how do I create the 'Item' array element in the first place.)
Yes, SQL can store the data you describe quite well.
Here are a few terms you may want to research:
1) Primary key
2) Foreign key
Basically what you describe is a classic Master-detail relationship where the Order is the master and the Items are the details. You would define a primary key on the Order table which uniquely defines the order, then that primary key is used in the Items table as a foreign key (relating all of the Items back to the single Order).
When you do updates to the Order/Items, you will use a transaction which ensures that all of the updates across all of the records are performed consistently or not at all.
here i am getting data for dt
column1 column2 column3
data1 data2 data3
now i want to delete data as well as columns....when i use dt.clear() only data is getting deleted...ie the o/p is as follows
column1 column2 column3
what is d syntax to delete data as well as column names.....pls help me
I am building a website in which I need to show the price of items in different currencies depending on the country chosen by the user.The price has to be dynamically updated daily based on the exchange rate. How do I go about doing this in ASP.NET?
I need to show the price of items in different currencies depending on the country chosen by the user.
This suggests you to have a dropdown where user can select country and thus currency.
Based on the dropdown selection, get the latest data, convert anything that needs to be based on currency multiplier and then use the modified data as input for the page display.
Actually,I'm not using a dropdown list.The website is an international one in which there are different home pages for different countries.So,I want to show the images and prices of different watches on the website and the price should be updated dynamically depending on the exchange rate.So,how do I get the exchange rate values to do such a dynamic update?
The website is an international one in which there are different home pages for different countries.
Even then, there must be something that is driving the localization. Dropdown is just a way to know what country/currency. Whichever way you are chaning your homepage, based on the same paramter your data should be changed/driven.